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

GridOperationMode and forcing server request

1 Answer 49 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.
Dickie
Top achievements
Rank 1
Dickie asked on 27 Mar 2012, 02:28 PM
I have a grid that has no paging, so I'd like to use GridOperationMode.Client for sorting. I also am using a modal window for editing this record, but when saving, I'd like to maintain the sorting in the grid and refresh it with a server-side hit. The problem I'm having is that ajaxRequest() won't hit the server and rebind() doesn't maintain sorting.

Is there some way to get the functionality I want? Would I just need to save the current orderBy expression, 
use rebind(), and reapply the orderBy after binding, via the sort() function?

1 Answer, 1 is accepted

Sort by
0
Dadv
Top achievements
Rank 1
answered on 28 Mar 2012, 04:08 PM
Hi, you can found the current orderBy with this :

var order = $("#Grid").data("tGrid").orderBy;  (not found documentation about it)

Save the value (a string) in a javascript variable, use it with sort :

var grid = $("#Grid").data("tGrid");
grid.sort(order);
Tags
Grid
Asked by
Dickie
Top achievements
Rank 1
Answers by
Dadv
Top achievements
Rank 1
Share this question
or