nextdigital
15 Dec 2009, 7:26 PM
To reproduce, use the code below and drag 'My List' into 'Another Folder'... you should notice the source folder's icon change to the default leaf icon.
I believe this is because it's <tr> CSS class changes to x-tree-node-leaf
Ext.onReady(function(){
var treegrid = new Ext.ux.tree.TreeGrid({
width: 500,
height: 300,
renderTo: Ext.getBody(),
enableDD: true,
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'
}]
});
var json = [{
"errors": 0,
"name": "A Folder",
"recipients": 0,
"created": 1260287731,
"duplicates": 0,
"unsubscribed": 0,
"active": 0,
"iconCls": "icon-list",
"bounced": 0,
"sent": 0,
"expanded": true,
"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
}]
},{
"errors":0,
"name":"Another Folder",
"recipients":0,
"created":1260287731,
"duplicates":0,
"unsubscribed":0,
"active":0,
"iconCls":"icon-list",
"bounced":0,
"sent":0,
"children": []
}];
var root = new Ext.tree.AsyncTreeNode({
text: 'Lists',
draggable: false,
children: json,
id: 'root'
});
treegrid.setRootNode(root);
});
I believe this is because it's <tr> CSS class changes to x-tree-node-leaf
Ext.onReady(function(){
var treegrid = new Ext.ux.tree.TreeGrid({
width: 500,
height: 300,
renderTo: Ext.getBody(),
enableDD: true,
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'
}]
});
var json = [{
"errors": 0,
"name": "A Folder",
"recipients": 0,
"created": 1260287731,
"duplicates": 0,
"unsubscribed": 0,
"active": 0,
"iconCls": "icon-list",
"bounced": 0,
"sent": 0,
"expanded": true,
"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
}]
},{
"errors":0,
"name":"Another Folder",
"recipients":0,
"created":1260287731,
"duplicates":0,
"unsubscribed":0,
"active":0,
"iconCls":"icon-list",
"bounced":0,
"sent":0,
"children": []
}];
var root = new Ext.tree.AsyncTreeNode({
text: 'Lists',
draggable: false,
children: json,
id: 'root'
});
treegrid.setRootNode(root);
});