[SOLVED] Smart Select, set selected option on app init

Hello,

I have a smart select component where I fetch all my categories with json request.
When the user select a value, I store it in localstorage

I would like to, on app start, get the value from localstorage, then set the option who get the same value as selected

Can we achieve this ?

It has setValue() method https://framework7.io/docs/smart-select.html#smart-select-methods-properties

var someThing = localStorage.someThing;
app.smartSelect.get('.some-smart-select').setValue(someThing);
1 Like

Oh ok I didn’t understand it’s worked like that
Thanks !