Results 1 to 2 of 2

Thread: [TreeGrid] Load different components/columns to child and parent rows

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default [TreeGrid] Load different components/columns to child and parent rows

    Hi,

    I have question if it is possible to load/show/hide component in Ext.tree.Panel column depend on row data value.
    So for example i have columns :

    Code:
     columns: [{
                    xtype: 'treecolumn',
                    flex: 2,
                    dataIndex: 'name'
                },{
                    flex: 1,
                    dataIndex: 'type'
                }, {
                    width: 55,
                    xtype: 'actioncolumn',
                    handler: function(grid, rowIndex, colIndex, actionItem, event, record, row) {
                        Ext.Msg.alert('Test', record.get('name'));
                    }
                }, {
                    width: 55,
                    xtype: 'actioncolumn',
                    handler: function(grid, rowIndex, colIndex, actionItem, event, record, row) {
                        Ext.Msg.alert('Editing', record.get('name'));
                    }
                }]
    and if type value will be 'a' add some columns or remove ?

    My Model:
    Code:
      Ext.define('MyApp.model.ME', {
            extend: 'Ext.data.Model',
            fields: [{
                name: 'testId',
                type: 'int'
            }, {
                name: 'name',
                type: 'string'
            }, {
                name: 'type',
                type: 'string'
            }],
            idProperty: 'testId'
        });
    So basicly I want to have different column set for parent and child rows in TreeGrid.

    It is possible?

    Thx

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505
    Vote Rating
    255
      0  

    Default

    You're wanting to dynamically change what columns exist in the treegrid? Or you want to change how the rows / treeNodes are rendered (not the columns)?

Posting Permissions

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