PDA

View Full Version : Refresh Column Tree



Johnny M
25 May 2009, 11:34 PM
Hi.

I'm modyfing this example: http://extjs.com/deploy/dev/examples/tree/column-tree.html

What I need is to change value in extra column , for example Assigned to (on javascript side).

I was trying:
var edNode = tree.selModel.selNode;
edNode.attributes['assigned'] = 'Johnny Walker';
edNode.attributes.assigned = 'Johnny Walker';

but it doesn't work.

edNode.setText('test') is working.

Please.... HELP!

eugs51
6 May 2010, 6:56 PM
No you cant refresh it thru the object because it doesnt have modify event. You need to do it directly in the html.



modifyDisplay:function(value,node){
var columnIndex = this.getColumnIndex(this.displayColumnId);
var treeCol = Ext.query("div.x-tree-col:nth-child("+(columnIndex+1)+")",node.ui.getEl().firstChild)[0];
if(treeCol!=null){
var column = this.tree.columns[columnIndex];
var display = Ext.query(".x-tree-col-text",treeCol)[0];
if(display!=null)
display.innerHTML = column.renderer?column.renderer.call(this,value,node,node.attr):value;
}
},