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

[Solved] Grid Filtering not working on client operation mode

0 Answers 46 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.
Bspreethi
Top achievements
Rank 1
Bspreethi asked on 15 Oct 2012, 02:53 PM
Hi,
I'm using telerik MVC grid filtering in client operation mode. I'm filtering grid based on textbox value entered.
searchGridItems is the textBox used and function Reset is calling on textBoxKeyPress.

I'm facing the following errors on implementation
1) Filtering working in And logic only. Can't able to work with Or logic
2) When clicking on pagination, filtering lost and grid showing all items

Please see the below code and help me ASAP
function Reset() {
        var _searchTerm = $("#searchGridItems").val();
        var grid = $('#Grid').data("tGrid");
        filterGrid(grid, _searchTerm, SelectedTab);    
    }

function filterGrid(grid, searchTerm, tabIndex) {
        var filterExpr = new Array();
        $.each(grid.columns, function (index, column) {
            if (column.type == "String") {
                    filterExpr.push({ field: column.member, operator: "substringof", value: searchTerm, logic: "or" });              
            }
        });
        if (filterExpr != "") {
            grid.dataSource.filter(filterExpr);
        }
    }
Tags
Grid
Asked by
Bspreethi
Top achievements
Rank 1
Share this question
or