Unfortunately, there are no « clean » way to limit the maximum number of characters (or more generally apply constraints) in edit mode of a tree, unlike textbox elements.
Here is the trick : the oninput event of a tree is only fired when you are editing :
Short tree example (limiting max number of characters to 10):
<tree hidecolumnpicker="true" minwidth="100px" height="300" editable="true" flex="1" oninput="event.originalTarget.value = event.originalTarget.value.substring(0,10);"> <treecols> <treecol primary="true" flex="1"/> </treecols> <treechildren context=""> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="mel@whereever.com"/> </treerow> </treeitem> </treechildren> </tree>
Commentaires
Ecrire un commentaire Trackback