1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
function renommer(e)
{
var domElement = e.target;
var nodeWidget = dijit.getEnclosingWidget(domElement);
alert(nodeWidget); // = null
//var item = dijit.getEnclosingWidget(node).item;
if(!nodeWidget || !nodeWidget.isTreeNode){
return;
}
ptTree.editing = true;
var labelNode = nodeWidget.labelNode;
var editSpan = document.createElement('div');
editSpan.innerHTML = labelNode.innerHTML;
labelNode.innerHTML = "";
//dojo.parser.parse(document.getElementById("ptTree"));
//dojo.connect(ptTree, "onDblClick", "renommerGroupe");
labelNode.appendChild(editSpan);
var editor = new dijit.InlineEditBox({
node: nodeWidget,
tree: ptTree,
model: ptTree.model,
autoSave: true,
onChange: function(val){
ptTree.model.store.setValue(this.node.item,'name', [val]);
this.tree.editing = false;
},
width: "100px"
}, editSpan);
editor.startup();
editor._edit();
} |
Partager