PDA

View Full Version : [FIXED][3.1pre] TreeGrid example strange column behaviour



nextdigital
8 Dec 2009, 8:30 PM
I am trying to load a TreeGrid using local json data the same way I would with a standard TreePanel, but if you have any 'leafs' in the root, the column data will not align correctly.

If I use the treegrid-data.json data provided with the example, everything works as expected.. so i'm guessing this component has only been tested with that data.



Ext.onReady(function(){
var treegrid = new Ext.ux.tree.TreeGrid({
width: 500,
height: 300,
renderTo: Ext.getBody(),
enableDD: true,
root: new Ext.tree.AsyncTreeNode({
text: 'Lists',
draggable:false,
id:'root'
}),
columns:[{
id: 'name',
header: 'List Names',
width: 200,
sortable: true,
dataIndex: 'name'
},{
id: 'recipients',
header: 'Recipients',
width: 75,
sortable: true,
dataIndex: 'recipients'
},{
id: 'created',
header: 'Created',
width: 75,
sortable: true,
dataIndex: 'created'
},{
id: 'sent',
header: 'Sent',
width: 75,
sortable: true,
dataIndex: 'sent'
}],
loader: new Ext.ux.tree.TreeGridLoader()
});

var json = [{
"errors":0,
"leaf":true,
"name":"My List",
"recipients":0,
"created":1260287731,
"duplicates":0,
"unsubscribed":0,
"active":0,
"iconCls":"icon-list",
"bounced":0,
"sent":0
},{
"errors":0,
"name":"A Folder",
"recipients":0,
"created":1260287731,
"duplicates":0,
"unsubscribed":0,
"active":0,
"iconCls":"icon-list",
"bounced":0,
"sent":0,
"children": [{
"errors":0,
"leaf":true,
"name":"A child List",
"recipients":0,
"created":1260287731,
"duplicates":0,
"unsubscribed":0,
"active":0,
"iconCls":"icon-list",
"bounced":0,
"sent":0
}]
}]

var root = new Ext.tree.AsyncTreeNode({
text: 'Lists',
draggable: false,
children: json,
id: 'root'
});
treegrid.setRootNode(root);
});

TommyMaintz
9 Dec 2009, 7:13 AM
Hi Nextdigital,

Thanks for testing the TreeGrid.
Your problem should be fixed in SVN build: 5759

P.S. You dont have to specify that loader or root in the initial TreeGrid configuration.

nextdigital
9 Dec 2009, 2:54 PM
thanks tommy, keep up the good work!

erojas
16 Feb 2010, 3:13 PM
I'm testing TreeGrid component, but I'm having troubles with it.

If TreeGrid has a Scrollbar, header titles didn't refresh, I have to move mouse over header and after that, header is refreshed.

And columns is not align with headers.

TreeGrid load data ok and nodes area ok too.

Thanks!