Datatable combo filtering with DataCollection

Hi,

I uses a comboBox to filter datatable. Data of combo are obtained from a DataCollection.
When I modify DataCollection combo is not refreshed automatically, except if I resize the column.

Here is a demo :
https://snippet.webix.com/seje1gku

What can I do to obtain the expected behavior ?

Comments

  • Hello,

    If you want to add another one value to the options list in the filter so it's better to make such steps:

    • first of all, you need to get the options list
    var addNewValue = $$("d1").getFilter("iD").getList();  
    
    • define a new value

    • refresh the list

    var addNewValue = $$("d1").getFilter("iD").getList();  
        var new_options = [
          {id: 2, value: 'deux'}
         ];
        addNewValue.refresh();
    
    • to use parse method (which is parsing new value into a popup list)
    addNewValue.parse(new_options);
    

    Please check the sample: https://snippet.webix.com/ec61dl1i

  • Hi,
    Many thanks about your example.
    But...

    The MVC paradigm allows you to modify data and have the views update automatically. No chance to just modify the data to get the same result?

  • By default combo imports original data and will not react on further changes.

    It possible to link data to the combo filter through .sync API , in such case, any changes in data will cause updating of the related widget.

    https://snippet.webix.com/wpcnicbd

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!