Featured post
extjs - Ext.js Editable TreeNodes -
is possible make treenodes (i.e. folders) editable user? see there's option called editable in treenode class couldn't working or find examples on usage.
my other quest place input box in nodes so, user can enter numbers each item. how can it?
adding new ext.tree.treeeditor(yourtree);
enough make tree editable.
but can define more using other 2 contructors parameters:
var te = new ext.tree.treeeditor(tree, new ext.form.numberfield({ allowblank: false, blanktext: 'a number required' }), { editdelay: 100, revertinvalid: false }); te.on("complete", function(node) { alert(node.startvalue + ' -> ' + node.editnode.text); });
there used numberfield can enter numbers in there.
and can restrict edition using editable
property of every treenode (yes, 1 mentioned), or using beforestartedit
event of treeeditor:
te.on('beforestartedit', function(ed, boundel, value) { if (ed.editnode.leaf) return false; });
at jsbin.com/extjs-treeeditor/2 have live example made based on sencha's checkbox treepanel example, diference can edit folder nodes on example.
just select folder , click again on folder, editor (a numberfield) should appear above folder's name.
- Get link
- X
- Other Apps
Comments
Post a Comment