Results 1 to 5 of 5

Thread: Store the GXT Grid state for the user in the cookie

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    47
    Vote Rating
    0
      0  

    Default Store the GXT Grid state for the user in the cookie

    I would like to persist the Grid configuration state information per user in a cookie.

    For example if the user selects one of the Grid Column to be ascending or hide one of the columns from the Grid in a cookie so that next time when the Grid is displayed for the same user it should display the Grid configuration state infromation from the cookie.

    Any help would be appreciated. If someone has a sample code as How i can use the GXT CookieProvider to store the Grid state information per user.

    Thanks.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    State management is already build into many components, so also into grids.

    Simple make the grid statefull and give it a unique stateId:

    Code:
    grid.setStateful(true);
    grid.setStateId("mygridsuniqeueid");

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    47
    Vote Rating
    0
      0  

    Default

    Hi Sven,

    For each user i should create a uniqueId of the grid state and then store the uniqueId in the cookie.

    ForExample HashMap obj = new HashMap();
    obj.put("user1","uniqueId");

    with GXT CookieProvider.set(obj)

    Thanks.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    Can you please explain the logic behind the code you just posted? I dont understand it. Have you tried the code i gave you?

  5. #5
    Sencha User
    Join Date
    Jul 2009
    Posts
    47
    Vote Rating
    0
      0  

    Default

    Sven,

    My apologies for the confusion with cookie logic.

    I got your logic that we can use the grid stateful feature and in that case we do not need to store the user specific grid state information in the cookie.

    I will try the logic which you have given.

    Thanks.

Similar Threads

  1. cookie state issue
    By babai in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 4 Jul 2010, 4:09 AM
  2. Setting and retrieving cookie for user that is logged in
    By oshannon in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 15 Jun 2009, 5:56 AM
  3. How to check Cookie enabled in user's browser?
    By Shini in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 21 Aug 2008, 3:33 AM
  4. How to save/load Grid columns view state (hidden or not) in a cookie?
    By KTamas in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 30 Apr 2008, 4:53 AM
  5. Cookie state undefined
    By galdaka in forum Ext 1.x: Bugs
    Replies: 2
    Last Post: 20 Feb 2007, 1:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •