Pasting Titles of DataTree Items, Programming Examples of Pasting Titles of DataTree Items

Programming Examples of Pasting Titles of DataTree Items

Get the code for effortless titles pasting of the DataTree items. With this programming example, you can write a new item's name in a textarea, then press CTRL+C to copy the text. The last step is selecting a node in DataTree and pressing Ctrl+V. Viola! Your item has a new name now. Feel free to use coding samples by Webix.

JS Code

var tpl = "<strong>Pasting Titles of Items</strong><br><br>"+
    "Press CTRL+C to copy the text in the textarea.<br>"+
	"Then select some node in DataTree and press Ctrl+V";

webix.ui({
  type:"clean",
  rows:[
    {template:tpl,height:100},
    { height:200, type:"clean",
      cols:[
    {	
      view:"tree",
      width:300,
      select: true,
      clipboard: true,
      data: [
        { id:"1", open:true, value:"The Shawshank Redemption", data:[
          { id:"1.1", value:"Part 1" },
          { id:"1.2", value:"Part 2" },
          { id:"1.3", value:"Part 3" }
        ]},
        { id:"2", value:"The Godfather", data:[
          { id:"2.1", value:"Part 1" },
          { id:"2.2", value:"Part 2" }
        ]}
      ]
    },
      {view:"textarea",value:"New item name",width:300}
    ]}
  ]
});