i am doing my grid binding, sorting, paging client side
i have handled the client side oncommand event like below as an example
now it is the else part (reverting the grid to its precommand state) that i need help on
this is what happens in the case of changing the page index
i have a hundred records of page size 10
i am on page 4
i change something somewhere
i change to page 7
on confirm i refuse
result is the page index is still changed to 7 even though i cancelled the event
with sort the sort icon will remain on the previously sorted column (even though i have not allowed multi column sorting)
with pagesize change the new page size will change even though i cancelled
so i guess the question is how do i restore the grid to still select the page 4 that was still selected above or make the sort icon not show on the newly clicked (but sort command cancelled) column? or rever the page size?
thanx
i have handled the client side oncommand event like below as an example
| function radGrid_Command(sender, e) { |
| showloadingpanel(true); |
| e.set_cancel(true); |
| var commandName = e.get_commandName(); |
| switch (commandName) { |
| case 'Sort': |
| case 'Page': |
| case 'PageSize': |
| //if the page has unsaved changes etc etc |
| if (confirm("changes not saved, continue?")){ |
| //pagemethod get my data using the grid pagesize, pageindex, sortcolumn, sort direction, rebind the grid on callback etc etc |
| } |
| else{ |
| //revert the sort, page or pagesize that was changed |
| showloadingpanel(false); |
| default: |
| break; |
| } |
| } |
now it is the else part (reverting the grid to its precommand state) that i need help on
this is what happens in the case of changing the page index
i have a hundred records of page size 10
i am on page 4
i change something somewhere
i change to page 7
on confirm i refuse
result is the page index is still changed to 7 even though i cancelled the event
with sort the sort icon will remain on the previously sorted column (even though i have not allowed multi column sorting)
with pagesize change the new page size will change even though i cancelled
so i guess the question is how do i restore the grid to still select the page 4 that was still selected above or make the sort icon not show on the newly clicked (but sort command cancelled) column? or rever the page size?
thanx