You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Load Items into Remote Control - Hack (working for me) #522
Note, model is my valueField, labelField and searchField.
As I am looping and creating the object, I then pass over to a custom method that I created called preLoad. Which I placed under "refreshOptions".
preLoad: function(data){varself=this;// Add options to be able to insert the itemsthis.options=data;// Add itemsObject.keys(data).forEach(function(key){self.addOption(key);self.addItem(key);});// Clear Optionsself.options=self.sifter.items={};},
Now I get items added in with no problems on init of the control 👍
Hopefully this gets added / or used for better functionality in the base :)
Activity
YevSent commentedon Aug 7, 2014
@no1youknowz, thanks for your decision, it very helpful for me. Good job 👍
YevSent commentedon Aug 8, 2014
Also, in my case, I've added
selectize.clearOptions();before setoptionsto correct items creating.Added support for using `dataAttr` to hydrate a text input element: `…
brianreavis commentedon Jan 30, 2015
See the 0.12.0 release for this. Selectize now recognizes the
dataAttrattribute (data-databy default) for populating the initial values.vedsingh-fullstack commentedon Aug 20, 2015
Can u give an example of how u used preLoad .Can it be used with ajax so that the options are populated based on ajax data