Barius
24 Aug 2007, 10:38 AM
What I want to do is to have an editable tree node that show the text 'Selected Pages: ##' when not being edited, but just shows the '##' when editing.
I have tried to change the values during 'beforestartedit' and again in 'beforecomplete' and also in 'complete'. Unfortunately, I cannot get the text displayed to change no matter what I do.
Here's an example of what I've tried so far:
ge = new xt.TreeEditor(ctree, {
allowBlank:false,
blankText:'Some text',
selectOnFocus:true
});
ge.on('startedit',function(boundEl,value){
if(ge.editNode.attributes.selectedPages){//Note: this is always true
var tmp = value.split(':');
ge.setValue(tmp[1]);
boundEl.value = tmp[1];
ge.editNode.text = tmp[1];
value = tmp[1];
return true;
}
});
ge.on('beforecomplete', function(myEditor, current, original){
if(ge.editNode.attributes.selectedPages){
myEditor.setValue('Selected Pages: '+current);
myEditor.value = 'Selected Pages: '+current;
ge.editNode.text = 'Selected Pages: '+current;
ge.editNode.attributes.selectedPages = current;
return true;
}
});
I have tried to change the values during 'beforestartedit' and again in 'beforecomplete' and also in 'complete'. Unfortunately, I cannot get the text displayed to change no matter what I do.
Here's an example of what I've tried so far:
ge = new xt.TreeEditor(ctree, {
allowBlank:false,
blankText:'Some text',
selectOnFocus:true
});
ge.on('startedit',function(boundEl,value){
if(ge.editNode.attributes.selectedPages){//Note: this is always true
var tmp = value.split(':');
ge.setValue(tmp[1]);
boundEl.value = tmp[1];
ge.editNode.text = tmp[1];
value = tmp[1];
return true;
}
});
ge.on('beforecomplete', function(myEditor, current, original){
if(ge.editNode.attributes.selectedPages){
myEditor.setValue('Selected Pages: '+current);
myEditor.value = 'Selected Pages: '+current;
ge.editNode.text = 'Selected Pages: '+current;
ge.editNode.attributes.selectedPages = current;
return true;
}
});