Results 1 to 2 of 2

Thread: Render fail in process to restore grid state

  1. #1

    Default Render fail in process to restore grid state


    I have one griview whit some columns, then in the forum I found some code to save and restore the state of the columns int one database. I'am successful return the information about It in the database and send to the grid. But when I iterate in the cm.Config and set the values for each config and call the cm.setConfig(newConfig), the columns is not rendered correctly. see in the picture attached.

    var or = Ext.decode(response.responseText); // the state return in the db
    if (or.Success) {    
        var cm = grid.getColumnModel();                        
        var newConfig = cm.config;
        ds = grid.getStore()
        for (var i = 0; i < or.Result[0].Data.length; i++) {                    
                newConfig[i].dataIndex = or.Result[0].Data[i].dataIndex;
                newConfig[i].hidden = or.Result[0].Data[i].hidden;
                newConfig[i].width = or.Result[0].Data[i].width;
                sort = {
                        direction : or.Result[0].Data[i].direction,
                        dataIndex : or.Result[0].Data[i].dataIndex
            if (sort) {
                ds.sort(sort.dataIndex, sort.direction);
        cm.setConfig(newConfig); At this point, the columns are not rendered correctly.
    Well, where I'am write someone wrong? It is missing some configuration? Below in the left picture the correctly columns rendered whit default grid columns config, and in the right picture, the worng columns after the call to cm.setConfig(newConfig) to set the stored state columns config.
    Attached Images Attached Images

  2. #2



Posting Permissions

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