NEW VERSION RELEASED! Webix 11 Read More Core Updates, Extended Functionalities in SpreadSheet and File Manager and more

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

/*
  This sample shows how you can copy data from nodes and paste them to other areas. 
  
  Press Ctrl+C to copy the text in the textarea. 
  Then select some node in Tree and press Ctrl+V
*/

webix.ui({
  rows:[
    { 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}
    ]}
  ]
});