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

[Solved] Save the grid filter

1 Answer 109 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.
Vinicius
Top achievements
Rank 1
Vinicius asked on 02 Jul 2011, 10:11 PM
Is there any easy way to save the grid filter on session, or cookie, or something similar?

1 Answer, 1 is accepted

Sort by
0
Vinicius
Top achievements
Rank 1
answered on 04 Jul 2011, 04:13 AM
var pref = $("#grid-filter-name").val();
var orderBy = $.cookie(pref + "orderBy");
var filterBy = $.cookie(pref + "filterBy");
var page = $.cookie(pref + "page");

var grid = $(this).data('tGrid');
if (filterBy) grid.filter(filterBy); // causes the grid to update here
if (page) grid.pageTo(page); // and here
if (orderBy) grid.sort(orderBy); // and here again!

Is there any way to make the grid updates just one time?
Tags
Grid
Asked by
Vinicius
Top achievements
Rank 1
Answers by
Vinicius
Top achievements
Rank 1
Share this question
or