Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Maintaining State in IgGrid
posted

Hi,

Can I maintain the state of igGrid. Suppose the user is on Page 2 in grid and with filter set on one column.

Next time user visited the same page and I bind data and set page number 2 and filter row open and fill the filer column textbox with the same old value

Parents
No Data
Reply
  • 23953
    Suggested Answer
    Offline posted

    Hi,

     

    You can use cookies to persist features states.

    For example you can get igGridPaging pageSize/pageIndex properties on igGridPaging.pageIndexChanged and igGridPaging.pageSizeChanged events and then create/update cookie.

    When the user returns to the same page get the cookie value and use it to restore the paging state.

    For filtering you can get the current filter on igGridFiltering.dataFiltered event with this code:

    var filteringExpressions = $("#grid1").data("igGrid").dataSource.settings.filtering.expressions;

    and then create/update cookie.

    When the user returns to the same page get the cookie value and restore the filtering state by using the igGridFiltering.filter method.

     

    Hope this helps,

    Martin Pavlov

    Infragistics, Inc.

Children