It looks like a bug. Sync filtering doesn’t work in Combo.
I’ve had an example.
var data = [{id: 1, value: "Record 1"},
{id: 2, value: "Record 2"},
{id: 3, value: "Record 3"},
{id: 4, value: "Record 4"}];
webix.ui({
rows: [{
view: "combo",
id: "combo",
label: "Combo",
options: []
}, {
view: "list",
id: "list",
label: "List",
options: []
}, {}]
});
var store = new webix.DataStore();
// OK. Only 2 records
$$("list").sync(store, function () {
this.filter(function (data) {
return data.id > 2;
})
});
// Error. 4 records
$$("combo").getPopup().getList().sync(store, function () {
this.filter(function (data) {
return data.id > 2;
})
});
store.importData(data);
My workaround looks like that. One more DataStore.
var comboStore = new webix.DataStore();
comboStore.sync(store, function() {
this.filter(function (data) {
return data.id > 2;
})
});
$$("combo").getPopup().getList().sync(comboStore);