1. #1
    Sencha User
    Join Date
    Jul 2007
    Posts
    15
    Vote Rating
    0
    stailer is on a distinguished road

      0  

    Default [CLOSED] [3.0RC1.1] Save state GridPanel

    [CLOSED] [3.0RC1.1] Save state GridPanel


    Hello,

    I think found a bug in the restore state with multiple GridPanel.

    Sequence :
    i open Ext.Window with GridPanel stateId : 'grid11'
    change size columns, hidden many columns..

    Reload page ok, i restore state GridPanel grid11

    i open Ext.Window with an another GridPanel stateId : 'grid12' in first :
    false size columns, false hidden columns..

    Reload page ok ONLY if i open Ext.Window with GridPanel 'grid12'
    after if i open Ext.Window with GridPanel 'grid11' it's ok

    But state is "silly" if i open Ext.Window with GridPanel 'grid11' in first :
    false columns size, false columns hidden etc....

    I don't understand and i think it's a bug
    Last edited by stailer; 25 May 2009 at 11:17 AM. Reason: Update text

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,445
    Vote Rating
    129
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    stailer -

    Could you post a test case which illustrates the bug which you are encountering along with a detailed set of steps of how to reproduce the issue?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Jul 2007
    Posts
    15
    Vote Rating
    0
    stailer is on a distinguished road

      0  

    Default


    Ok.

    uses with screenshot and code :

    1) uses

    a)
    - start application and i open my gridpanel : http://www.spread-share.com/extjs_bu...acts_start.jpg

    - i modify my gridpanel : http://www.spread-share.com/extjs_bu...acts_modif.jpg

    I reload my page, all is good. If i open my page, i restore my state like http://www.spread-share.com/extjs_bu...acts_modif.jpg

    b)

    - i open an another ext window with another gridpanel :
    http://www.spread-share.com/extjs_bug/event_config.jpg


    I reload my page and i load my window with http://www.spread-share.com/extjs_bug/event_config.jpg
    AFTER i open my window with first grid and all is always good.

    BUT if i reload my page and i load first window my result is :
    http://www.spread-share.com/extjs_bu...acts_broke.jpg

    I must reload my page and open my second window and after my first window for restore state ok else
    my first gridpanel is broke.



    Now , my code for my first window :

    Code:
    
     winContacts = new Ext.Window({
                    title    : 'Contacts',
                    iconCls : 'icon-window-contacts',
                    collapsible:true,
                    stateId : 'window-contacts',
                    closable : true,
                    width    : 800,
                    height   : 500,
                    border : false,
                    closeAction :'hide',
                    layout:'border',
    
                    items:[contacts_panel]
                });
    
    // panel with gridpanel :
    
    var contacts_panel = new Ext.TabPanel({
                region    : 'center',
                margins   : '3 3 3 0',
                activeTab : 0,
                plain: true,
                name: 'contacts_panel',
                id : 'contacts_panel',
                stateId:'contacts-panel',
                enableTabScroll: true,
                resizeTabs: true,
                defaults: {autoScroll: true},
                layoutOnTabChange: true,
                minTabWidth: 145,
                tabWidth: 145,
                items:[
                      {title:'Contacts du cabinet', id:'panel_listcontacts',stateId:'panel-listcontacts',  autoLoad:{url:websiteroot+'listcontacts/contacts', scripts:true}},
                      {title:'Nouveau', id:'panel_addcontact', stateId:'panel-addcontact',  autoLoad:{url:websiteroot+'addcontacts/addtab', scripts:true}}
                 ]
    });
    code gridpanel in ajax script :

    Code:
    ...
    // CONFIGURATION DES COLONNES
    var cm_contacts = new Ext.grid.ColumnModel([
        {header: 'Type de contact', width:130, dataIndex: 'TypeContact', sortable : true  },
        {header: 'Civilité', width:50, dataIndex: 'civilite', sortable : true  },
        {header: 'Nom', width: 150,  dataIndex: 'nom', sortable : true },
        {header: 'Prénom', width: 100,   dataIndex: 'prenom' , sortable : true },
        {header: 'Email', width: 150,   dataIndex: 'email', sortable : true  },
        {header: 'Tel. fixe', width: 100,   dataIndex: 'tel_fixe', sortable : true  },
        {header: 'Tel. port', width: 100,   dataIndex: 'tel_port', hidden: true, sortable : true  },
        {header: 'Tel. fax', width: 100,   dataIndex: 'tel_fax', hidden: true, sortable : true  },
        {header: 'Actions', width: 90,   dataIndex: 'uid', renderer : buttonsActionContacts}
    ]);
    cm_contacts.defaultSortable = true;
    
    
    // PARAMETRAGE DU GRID
    var grid_contacts = new Ext.grid.GridPanel({
            store: PortalAvocat.Contacts.StoreContacts,
            cm: cm_contacts,
            triggerAction:'all',
            name: 'grid_contacts',
            id : 'grid_contacts',
            autoHeight:true,
            stateId: 'grid_contacts',
            bbar: pagingBar,
            bodyStyle:'padding:3px 3px 0',
            view: new Ext.ux.BufferView({ rowHeight: 30})
     });
    ...
    Bufferview is not a problem, i tried without.

    I don't understand this problem ?

    Ajax ? script=true ? phpsessid in cookie with php ?

    I think it's a bug from ExtJS but i m not sure

  4. #4
    Sencha User
    Join Date
    Jul 2007
    Posts
    15
    Vote Rating
    0
    stailer is on a distinguished road

      0  

    Default


    An idea :

    I m using SessionProvider inside CookieProvider for test....

    And i have a javascript error on state restore gridpanel : "e is undefined".

    I think this method is a problem :

    Code:
       {title:'Nouveau', id:'panel_addcontact', stateId:'panel-addcontact',  autoLoad:{url:websiteroot+'addcontacts/addtab', scripts:true}}
    All is good with state but not gridpanel in autoLoad. Maybe problem is here ?

  5. #5
    Sencha User
    Join Date
    Jul 2007
    Posts
    15
    Vote Rating
    0
    stailer is on a distinguished road

      0  

    Default


    ok problem is solved :

    In my ColumnModels on GridPanels there is not "ID" by column...
    Code:
    ...
    {header: 'Nom', width: 150,  dataIndex: 'nom', sortable : true },
    ...
    I added "id" on each column and now all is ok.
    Code:
    ...
    {id: 'nom' , header: 'Nom', width: 150,  dataIndex: 'nom', sortable : true },
    ...
    It's logic but i'm not expert ExtJS. Sorry.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,166
    Vote Rating
    674
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Closing this one off.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 2