Here’s what works for me…
**Inline editing where tree is connected to a DataProcessor
In the tree object’s onEditCell event, at stage 1, decode first
iTree.attachEvent("onEditCell", function(stage, rId, cInd, nValue, oValue) {
if(stage == 0) {
...
return true
}else if(stage == 1 && this.editor && this.editor.obj) {
this.editor.obj.value = myDecode(this.editor.obj.value); //<= decode all &,>,<,etc to &,>,< etc.
this.editor.obj.select();
return true;
}else if(stage == 2) {
...
return true;
}
});
In the ajax broker script referenced by the DP (e.g. C#)
...
if (action == "updated") {
string o_Node = context.Request["o_Node"];
data = "<updated o_Node=\"" +myHtmlEncode(o_Node)+ "\" />"; // If you need to send data back, encode it
//call the update script sending the decoded o_Node
//return some xml including the above data string
}
...
**Editing the contents of a tree cell via your own custom dialog/form (e.g. dhtmlxForm)
When setting the form’s object’s hidden/input values, decode first
...
fmForm.setItemValue("action", "update");
...
fmForm.setItemValue("f_Node", myDecode(sTree.cells(sTree.getSelectedId(),NodeCellIndex).getValue())); //<= decode all &,>,<,etc to &,>,< etc.
...
In the ajax broker script referenced by the form (e.g. C#)
...
if (action == "update") {
string o_Node = context.Request["f_Node"];
data = "<updated o_Node=\"" +myHtmlEncode(o_Node)+ "\" />"; // If you need to send data back, encode it
//call the update script sending the decoded o_Node
//return some xml including the above data string
}
...
Hope this is useful to someone.
Mark