Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Client Side Filtering and Sorting

$
0
0

We are doing filtering and sorting client side. We hook into the change event and filter out the results. All is well until the sort is done descending. The correct number of records are displayed but the records themselves are the wrong ones. It's like the indexing is wrong on the displayed records. Can someone point me at what to look at to figure his out. Thanks.

 

01.functionfilterButtonClicked(gridId) {
02.    vargrid = $("#"+ gridId.toLowerCase() + "Grid").data("kendoGrid");
03.    varfiltertxt = $("#txt"+ gridId + "Filter").val().trim().toLowerCase();
04.    $("#"+ gridId.toLowerCase() + "Grid")
05.        .find("table > tbody > tr")
06.        .each(function(i) {
07.            varcurrentRow = $(this);
08.            vardisplayName = grid.dataSource.data()[i].DisplayName.toLowerCase();
09.            // See if filter should be applied
10.            console.log(filtertxt);
11.            console.log(displayName);
12.            if(displayName.indexOf(filtertxt) >= 0) {
13.                currentRow.show();
14.            } else{
15.                currentRow.hide();
16.            }
17.        });
18.}

And this is the grid event hook but the event is getting called just fine.

1.    ...
2.    dataBound: gridOnDataBound,
3.    change: filterButtonClicked('Available')
4.}).data("kendoGrid");

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>