PDA

View Full Version : TreeGrid Column Headers Not Behaving



extAsplode
31 Aug 2010, 2:12 PM
It looks as though the Columns collection in the TreeGrid control doesn't behave as columns do inside GridPanels. If I set resizable: false on a column, it's still resizable. In the example below (from the Ext TreeGrid example source), I've added resizable: false, menuDisabled: true, and sortable: false, but these properties don't look like they're taking effect. What do I need to do to get the control to respect these properties?



Ext.onReady(function(){
Ext.QuickTips.init();

var tree = new Ext.ux.tree.TreeGrid({
title: 'Core Team Projects',
width: 500,
height: 300,
renderTo: Ext.getBody(),
enableDD: true,

columns:[{
header: 'Task',
dataIndex: 'task',
width: 230,
resizable: false,
menuDisabled: true,
sortable: false
},{
header: 'Duration',
width: 100,
dataIndex: 'duration',
align: 'center',
sortType: 'asFloat',
tpl: new Ext.XTemplate('{duration:this.formatHours}', {
formatHours: function(v) {
if(v < 1) {
return Math.round(v * 60) + ' mins';
} else if (Math.floor(v) !== v) {
var min = v - Math.floor(v);
return Math.floor(v) + 'h ' + Math.round(min * 60) + 'm';
} else {
return v + ' hour' + (v === 1 ? '' : 's');
}
}
})
},{
header: 'Assigned To',
width: 150,
dataIndex: 'user'
}],

dataUrl: '/10/treegrid-data.json'
});

});
Thanks,
Andy

kollepara
2 Sep 2010, 8:11 AM
This is because it uses Class Ext.list.Column doesn't have those configuration properties