This question is locked. New answers and comments are not allowed.
I'm using ajax to bind my grid and I have a default sortable expressions defined like so:
I'm defining filter values on "OnDataBinding" like so:
When a drop down value is changed i'm rebining the grid, but for some reason the grid's sorting state is whiped out, i.e. the "orderBy" property of the grid is empty after doing a rebind. So I have to reset it when rebinding like so:
Why do I have to do this? Shouldn't the grid remember its sorting expression on rebind?
.Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.DateCreated).Descending()))I'm defining filter values on "OnDataBinding" like so:
function onDataBinding(e) { var filter = getFilter(); e.data = filter; }When a drop down value is changed i'm rebining the grid, but for some reason the grid's sorting state is whiped out, i.e. the "orderBy" property of the grid is empty after doing a rebind. So I have to reset it when rebinding like so:
function RebindGrid() { var grid = $('#Grid').data('tGrid'); var sortOrder = grid.orderBy; grid.rebind({ orderBy: sortOrder }); grid.orderBy = sortOrder; }Why do I have to do this? Shouldn't the grid remember its sorting expression on rebind?