Smart select - Multiple (appended item starting selected)

Guys,

How can i uncheck the auto selected smart select values?
The choices if I open the popup still checked automatically after append.

Using kitchen sink

              <li>
              <a class="item-link smart-select smart-select-init" data-open-in="sheet">
                <select name="color" id="color" multiple>
                  <option value="1">Test</option>
                  <option value="2">Test 2</option>
                  <option value="3">Test 3</option>
                </select>
                <div class="item-content">
                  <div class="item-inner">
                    <div class="item-title">Color</div>
                  </div>
                </div>
              </a>
            </li>

          $('#color')
                .append($("<option></option>")
                .attr("value",item.value)
                .text(item.color)); 
            } 

image

Deselect first

$('#company-select select>option[value="'+cId+'"]').removeAttr('selected');

Then select smart start

app.smartSelect.create({

                    el:'#company-select',
                    popupPush:true,
                    popupSwipeToClose:true,
                    searchbar:true,
                    searchbarPlaceholder:'Search..'

                });
2 Likes

Thank you @uslualper

How can i change multiple values using .change()?

$$('.select').val(some val).change();

Select type multiple :slight_smile:

Your answer is here : https://framework7.io/docs/dom7.html

$$(’… ').each(callback) -> you need a each function. You should look one by one because the values are different.

alternative : $$(’… ')…filter(callback);