1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
    ketanmaheta is on a distinguished road

      0  

    Default Unanswered: Cookies state management not working

    Unanswered: 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 - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Answers
    442
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      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/).

Thread Participants: 1