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

[Solved] Reset paging when grid is cleared

1 Answer 97 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.
Tony
Top achievements
Rank 1
Tony asked on 20 Jul 2011, 04:32 PM
Hi,

I have an app that populates a grid based on search criteria. A requirement is that the grid must be cleared if any piece of the search criteria changes. On the client side I clear the grid as follows:

$(

 

'#gridSearch').data('tGrid').dataBind(null);

 


This removes all the visible rows from the grid as expected. However, if there were multiple pages of data the paging navigation still appeares and if it clicked on the grid repopulates with the old data. Since I have the grid clearing as expected how do also clear the navigation?

1 Answer, 1 is accepted

Sort by
0
Tony
Top achievements
Rank 1
answered on 21 Jul 2011, 12:32 AM
I found this:

$(

 

'#gridSearch .t-grid-pager').hide();
which I use on the client side after setting the grid data to null

While it does not reset the paging it does hide it. This effectively stops the user from being able to click to another page. Once new criteria is entered and searched the grid is re-populated and the pager displays properly.

 

Tags
Grid
Asked by
Tony
Top achievements
Rank 1
Answers by
Tony
Top achievements
Rank 1
Share this question
or