PDA

View Full Version : [TreeGrid] Load different components/columns to child and parent rows



chio1
5 Jul 2013, 4:30 AM
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 :


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:

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

slemmon
8 Jul 2013, 11:26 AM
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)?