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

[Solved] Ajax Grid Filtering

1 Answer 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ng
Top achievements
Rank 1
Ng asked on 08 Nov 2011, 11:11 AM
I tried the solution here

http://www.telerik.com/community/forums/aspnet-mvc/grid/client-side-grid-filter-doesn-t-work-in-current-release.aspx

But it doesn't seem to work well. So I have made the following changes,

telerik.grid.filtering.js
filter: function (filterBy) {
    this.currentPage = 1;
    this.filterBy = filterBy;
 
    var filters = filterBy.split('~and~');
    for (var columnIndex = 0; columnIndex < this.columns.length; columnIndex++) {
        var column = this.columns[columnIndex];
        column.filters = [];
        for (var filterIndex = 0; filterIndex < filters.length; filterIndex++) {
            var tokens = filters[filterIndex].split('~');
            if (column.member == tokens[0]) {
                column.filters.push({ operator: tokens[1], value: tokens[2].replace(/'(.*?)'/, '$1') });
            }
        }
    }
 
    if (this.isAjax()) {
        this.$columns().each($.proxy(function (index, element) {
            $('.t-grid-filter', element).toggleClass('t-active-filter', this.columns[index].filters.length > 0);
        }, this));
 
        this.ajaxRequest();
    } else {
        this.serverRequest();
    }
}

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 09 Nov 2011, 03:34 PM
Hi Ng,

 Upgrading to Q2 SP1 (2011.2.914) should resolve the problem described in the other forum thread. Please upgrade your app and if the problem persists, send us a sample project so we can investigate further.

Kind regards,
Georgi Tunev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Ng
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or