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
But when I changed HTML: clear and add my custom options and called .sync() nothing is happened.
Steps to reproduce
let data = {
company: [ 8, 'XXXX' ],
company_name: 'sdf',
}
let form = $('form')[0];
debugger;
// This will create new .options for 'company' select element
FormDataJson.fromJson( form, data, { triggerChangeEvent: true, createNewOption: true } );
let select = $('#tszz')[0].tomselect;
select.sync();
select.refreshItems();
Synchronizes the Tom Select instance with the underlying select or input
It does not clear how it works.
TomSelect reads HTML and creates internal data structures to reflect this state
TomSelect removes any existing options from and creates fresh one from the internal state of TomSelect
PS. I changed the order, because after numbered list the formatting is broken.
The text was updated successfully, but these errors were encountered:
Furthermore sync() does not work if component was initialized like
new Autocomplete('#tszz',{
valueField: 'id',
labelField: 'name',
...
This happens because const settings = get_settings ? getSettings(self.input, { delimiter: self.settings.delimiter }) : self.settings; is called without manual parameters, thus getSettting fills text and value instead of configured name and id.
Expected behavior
I am trying to resolve this issue: #855
But when I changed HTML: clear and add my custom options and called .sync() nothing is happened.
Steps to reproduce
Additional context
Bug description
https://tom-select.js.org/docs/api/#sync
It does not clear how it works.
The text was updated successfully, but these errors were encountered: