Results 1 to 2 of 2

Thread: Cookies state management not working

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default Cookies state management not working

    Hi All,
    I am trying to save state of accordion for testing purpose but it is not working. I am not getting any error. In my test.html page, I am referring the required .css file along with ext-all-debug.js and the following js file.The code of js file is as below. I am referring example provided on http://examples.extjs.eu/

    Ext.BLANK_IMAGE_URL = './ext/resources/images/default/s.gif';


    var cp = new Ext.state.CookieProvider({
    expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 30)) //30 days
    });
    Ext.state.Manager.setProvider(cp);


    // application main entry point
    Ext.onReady(function () {


    var w = new Ext.Window({
    title: Ext.fly('page-title').dom.innerHTML
    , renderTo: Ext.getBody()
    ,stateId:'mywindowPnl'
    , layout: 'accordion'
    , width: 300
    , height: 300
    , closable: false
    , stateful: true
    , border: false
    , layoutConfig: { animate: true }
    , defaults: {
    stateEvents: ["collapse", "expand"]
    , getState: function () {
    return { collapsed: this.collapsed };
    }
    , bodyStyle: 'padding:8px'
    , border: false
    }
    , items: [{
    stateId: 'first'
    , title: 'First'
    , html: 'First'
    , collapsed: false
    }, {
    stateId: 'second'
    , title: 'Second'
    , html: 'Second'
    , collapsed: true
    }, {
    stateId: 'third'
    , title: 'Third'
    , html: 'Third'
    , collapsed: true
    }, {
    stateId: 'fourth'
    , title: 'Fourth'
    , html: 'Fourth'
    , collapsed: true
    }]
    });
    w.show();
    });

  2. #2
    Sencha - Documentation Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,162
    Answers
    501
    Vote Rating
    257
      0  

    Default

    I'm not having trouble with Saki's Ext Examples page saving state for me.
    I'm also not having trouble with state management using the example page here:
    http://docs.sencha.com/ext-js/4-2/ex...ate/state.html

    You might test and see if that second link there works for you.
    If so, you can leverage its code for your tests.

    If not, then perhaps the issue is related to cookie management on your browser or browsers.

    As an aside, when posting sample code snippets you should wrap your code using the code tags for thread readability.
    Also, if you have an inline, un-tabbed, script example it would be benefit readability if you indent each code block (you can paste and beautify code here: http://jsbeautifier.org/).

Posting Permissions

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