PDA

View Full Version : TreeGrid and Direct



vahid4134
5 Feb 2010, 12:50 PM
Anyone use load TreeGrid width Direct?
My code


var gridForum = new Ext.ux.tree.TreeGrid({
title: 'Core Team Projects',
width: 500,
height: 300,

enableDD: true,

columns:[{
header: 'Task',
dataIndex: 'task',
width: 230
},{
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'
}],

loader: new Ext.ux.tree.TreeGridLoader({
directFn: MyRIA.Forum.getList
})
});


and response



{"type":"rpc","tid":3,"action":"Forum","method":"getList","result":[{"task":"Project: Shopping","duration":13.25,"user":"Tommy Maintz","iconCls":"task-folder","expanded":true,"children":{"task":"Housewares","duration":1.25,"user":"Tommy Maintz","iconCls":"task-folder"}}]}


but I dont have any row in my TreeGrid /:)
This is bug or my code is incorrect?
Please help

vahid4134
6 Feb 2010, 12:10 AM
Anyone have ideas?

vahid4134
6 Feb 2010, 7:00 AM
in php code


public function getList() {


change to



public function getList($nodeId) {


but why I dont have any error?

padawan
4 Nov 2010, 10:03 AM
I had problems with this very same issue in Ext 3.3, many thanks for pointing this out :)