Skip to main content

editItem()

edits a Tree item

editItem(id: string | number, config: object): void;

Parameters:

  • id: string | number - the id of an item
  • config: object - optional, the config object of an editor. The parameter includes the following properties:
    • mode: string - the type of an editor:
      • "text" (by default) for an input
      • "select" for a select
    • options: array - optional, an array of additional options. It works only with mode: "select".

Example

tree.events.on("itemDblClick", function (id) {
tree.editItem(id);
});

// or

tree.events.on("itemDblClick", function (id) {
tree.editItem(id,{ mode: "select", options: [1, 2, 3, 4, 5] });
});