This is a migrated thread and some comments may be shown as answers.

Filter Multi Checkboxes - filter panel is not refreshing after changing data source in mvvm style

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Marcin asked on 27 May 2015, 01:23 PM

Dear Support team, 

We found an error that multi checkbox filter panel is not refreshing after changing data source in mvvm style. More is shown in attached dojo and screencast:

http://dojo.telerik.com/opURA

http://screencast.com/t/F4nzqodS

We created workaround about this error:

kendo.ui.FilterMultiCheck.prototype.refresh = function(e) {
    var forceUnique = this.options.forceUnique;
    var dataSource = this.dataSource;
    var filters = this.getFilterArray();
  
    if (this._link) {
        this._link.toggleClass("k-state-active", filters.length !== 0);
    }
  
    if (this.form) {
        if (e && forceUnique && e.sender === dataSource && !dataSource.options.serverPaging)
        //     (e.action == "itemchange" || e.action == "add" || e.action == "remove"))
        {
            this.checkSource.data(distinct(this.dataSource.data(),this.field));
            this.container.empty();
        }
  
        if (this.container.is(":empty")) {
            this.createCheckBoxes();
        }
        this.checkValues(filters);
        this.trigger('refresh');
    }
}

Problem was lack of field action in event parameter when change is done from mvvm. When we removed this condition application started working properly.

 

Marcin (Szwagier) Bębenek

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 29 May 2015, 01:32 PM

Hello Marcin,

This behavior is expected. In such scenarios you must define custom DataSource for the unique values and to update it once the Grid data source changes.

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Marcin
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or