Categories | Question details Back To List | ||||||||
select row after removing filter hi we have a grid with approx 2000 items in. we also have a filter box at the top of each column. when the user enters filter criteria it filters correctly. however we need the following functionaility but are unsure of the best way to do it... when the user has applied the criteria and are left with only a few rows, the user selects the row, then if they remove the filter criteria from the filter box and the rest of the rows show we still want the grid to scroll to the selected row. right now it is showing all rows when we remove the filter criteria but we have lost the selected row thanks Answer posted by Support on Apr 24, 2009 03:51 You can use onFitlerEnd event as grid.attachEvent("onFilterEnd",function(){ var id = mygrid.getSelectedRowId(); if (id) mygrid.showRow(id) }) Answer posted on Aug 15, 2009 07:23 we are trying the code that you suggested and this is having no effect. we mean when the filter text is set to blank (when the user removes the text that it is in the filter box) - this loads all rows back into the grid but the selected row is no longer in view, the user must manually scroll down to it... what is the best way to do this please? thanks Answer posted by Support on Aug 17, 2009 10:13 Please check the attached sample. Attachments (1)
Answer posted on Aug 18, 2009 02:22 ok, we see this does work in a grid but it does not work in treegrids that use a filter, how can we get it to work for treegrids? Answer posted by Support on Aug 18, 2009 02:30 showRow will not work for items which are inside closed branches. you can try to use the next line as first line of onFilterEnd handler grid.openItem(selected); as result it will open related branch, after that existing code must work correctly |