1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    235
    Vote Rating
    0
    chandan.behura is on a distinguished road

      0  

    Default Unanswered: How i will get the value in column header through function in gridPanel

    Unanswered: How i will get the value in column header through function in gridPanel


    Code:
        function start() {
            
            gridPanel = Ext.create('Ext.grid.Panel', {
                title : 'UDM',
                //store : udmStore,
                collapsible : true,
                columns : getColumns(),
                height : 200,
                width : 400,
                selType : 'cellmodel',
            
    
                renderTo : Ext.getBody()
            });
            
            gridPanel.center();
            
            
        }
        colHeader=['Subject','StudName','StudRoll'];
        function getColumns(){
            
            var colGrid=new Array();
        for ( var i= 0; i < colHeader.length; i++) {
            header=colHeader[i];
            colGrid.push('header:'+header);
        }
        }
        Ext.onReady(start);
    please help me
    regards chandan,
    Last edited by scottmartin; 25 Jul 2012 at 5:06 PM. Reason: Please format your code

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    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


    See if this is what you are looking for:

    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()
    });
    
    var columns = [{
        dataIndex: 'company',
        text: 'Company',
        flex: 1
    }];
    
    Ext.create('Ext.Button', {
        text: 'Click me',
        renderTo: Ext.getBody(),
        handler: function() {
            grid.headerCt.add(columns);
            grid.view.refresh();
        }
    });
    Scott.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    235
    Vote Rating
    0
    chandan.behura is on a distinguished road

      0  

    Default


    i got that solution....bellow is the solution but......
    please try to help me in my another thread i.e i have given the link

    http://www.sencha.com/forum/showthre...ded#post861101

    var gridPanel = Ext.create('Ext.grid.Panel', {
    title: 'Employees',
    columns: getColumns(),
    height: 200,
    width: 500,
    renderTo: Ext.getBody()
    });
    gridPanel.center();
    }

    var columnsIndex = ['empID','empName','email','sal'];
    var columnsHeader = ['Employee ID','Employee Name','Email','Salary'];
    var columnsSortable = [true,false,false,true];

    function getColumns()
    {
    var gridColumns = new Array();
    for(var i=0;i<columnsIndex.length;i++)
    {
    gridColumns[i] = {
    header : columnsHeader[i],
    dataIndex : columnsIndex[i],
    sortable : columnsSortable[i]
    };
    }
    return gridColumns;
    }

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