1. #1
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    62
    Vote Rating
    0
    info@ferraresegroup.com is on a distinguished road

      0  

    Default Unanswered: Add colum on gridPanel

    Unanswered: Add colum on gridPanel


    Hi all,
    i'm looking for add column on gridPanel.
    With add method no firebug error appear but layout don't change.


    var grid = new Ext.create('Ext.grid.Panel', {
    title: 'List',
    id: 'grid',
    flex: 1,
    store: 'storeGrid',
    columns: [
    new Ext.grid.RowNumberer(),
    {
    text: 'Prelievo',
    flex: 1,
    columns:[
    { header: "Label a", dataIndex: 'preA', flex:1},
    { header: "Delta", dataIndex: 'preB', flex:1}
    ]
    }
    ]
    });



    var newCol = Ext.create('Ext.grid.column.Column', {
    {
    text: 'New Column',
    flex: 1,
    columns:[
    { header: "Label B", dataIndex: 'preC', flex:1},
    { header: "Delta", dataIndex: 'preD', flex:1}
    ]
    }
    });
    grid.add(newCol);
    grid.doLayout();



    THX

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,918
    Answers
    655
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    In your column object, your are adding an array of columns:

    Try this:
    Code:
    Ext.create('Ext.data.Store', {
        storeId : 'simpsonsStore',
        fields  : ['name', 'email', 'change'],
        data    : {'items' : [
            { 'name' : 'Lisa',  'email' : 'lisa@simpsons.com',  'change' : 100  },
            { 'name' : 'Bart',  'email' : 'bart@simpsons.com',  'change' : -20  },
            { 'name' : 'Homer', 'email' : 'home@simpsons.com',  'change' : 23   },
            { 'name' : 'Marge', 'email' : 'marge@simpsons.com', 'change' : -11  }
        ]},
        proxy   : {
            type   : 'memory',
            reader : {
                type : 'json',
                root : 'items'
            }
        }
    });
    
    var grid = Ext.create('Ext.grid.Panel', {
        title      : 'Simpsons',
        store      : Ext.data.StoreManager.lookup('simpsonsStore'),
        columns    : [
            { header : 'Name', dataIndex : 'name' },
            { header : 'Email', dataIndex : 'email', flex : 1 },
            { header : 'Change', dataIndex : 'change'}
        ],
        height     : 200,
        width      : 400,
        renderTo   : Ext.getBody()
    });
    
    Ext.create('Ext.Button', {
        text: 'Click me',
        renderTo: Ext.getBody(),
        handler: function() {
            var column = Ext.create('Ext.grid.column.Column', {header: 'Column'});
            grid.headerCt.insert(grid.columns.length,column);
        }
    });
    Scott

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    62
    Vote Rating
    0
    info@ferraresegroup.com is on a distinguished road

      0  

    Default THX

    THX


    Thanks,
    it work fine.
    Luca F.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi