Sorry for late reply.
I have added to some test component in the componentDidMount, the next code:
let smartSelect = app.smartSelect.create({
el: ".testSmartSelect",
openIn: "page"
});
And in the same component’s render I have added this:
<select className="testSmartSelect">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
Later I did:
smartSelect.open();
But this didn’t work, and either I don’t want to put the tag directly in the HTML - what I am trying to achieve is that the Smart select data will be implemented programmatically in the smartSelect.create
method, for example something like this:
let options = [ { id: "A", value: "A"}, {id: "B", value: "B"} ... ];
let smartSelect = app.smartSelect.create({
el: ".testSmartSelect",
openIn: "page",
options: myOptions
});
This could be the best if this would be worked like I wrote above. In such a way I could attach the event to binded to Button element or something else.
This could even be much much better and makes F7 to be the boss of all frameworks if it could be added async, something like this:
let smartSelect = app.smartSelect.create({
el: ".testSmartSelect",
openIn: "page",
options: myOptions
});
smartSelect.open();
setTimeout(() => smartSelect.options(newOptionsFromAsync).process(), 10000 );
// new options will be implemented after 10s.
The process means to re-render those new options.
There could be even better better better if it had images or captions in the options array object.
I really love F7, hope Smart Select could be more dynamic. I hope it helped.