I’m wondering how customizable the in-line editor is.
I need a tree control with autocomplete. Based on the autocomplete selection I may need to save that item’s data and create additional edit controls on the same tree node, e.g.
[node autocompleter]
Under some conditions, e.g., user selects XYZ from the autocompleter, the node would then be:
XYZ [additional] [text] [fields]
Additional fields might also be autocompletes, if that matters.
When finished editing the node text would be generated from arbitrary node data based on the values from any/all fields that were edited. The tree node data would be whatever necessary for a complete representation of the node and to recreate the node edit controls.
I didn’t find anything obvious in the API that would allow me to do all this. Is this possible? If so, how onerous would it be?
When inline editing a node, instead of a single text field, I need an autocompleter. Once there’s an autocomplete selection, more controls show up in the same node.
Example, where text fields are represented by square brackets, e.g., [Release Date] is a text field that takes a movie’s release date.
Initial state of a single node:
[Product type]
It’s an autocomplete. Options include things like movies, shirts, batteries, games, etc. Things you might buy.
If I choose “Shirts” then the node would look like this:
Shirt [Size]
The [Size] field might be a select, text, or another autocomplete, it doesn’t matter.
If I choose batteries the node might look like this:
Battery [Size]
The additional fields might not be text boxes, it could be any form element or arbitrary HTML, e.g., radio buttons, explanatory text, an image, whatever.
Now do you understand?
Based on an initial form value, the node editor would have additional edit controls.
There is no native approach, but we can suggest you the next ways of implementation:
you can set event handller (i.e. boublleclick) to switch native tree editor to combo or html5 input with autocomplete mode using method setItemText(itemId, "<div_with_combo> or ") and then using i.e. onEnter js handler you can set chosen text to the node via the same method setItemText
To fill the rest data you can use the next sample:
tree_ID.xml:
you can use groupped grid with combos in edit mode (if you have not many nested levels) dhtmlx.com/docs/products/dht … group.html
You need to set suitable event handler (i.e. onEditCell or onRowDblClicked) and do the same manipulations as with tree with grid methods setValue the next way: docs.dhtmlx.com/doku.php?id=dhtm … setvalue&s[]=setValue