Dyanmic adding of treetable data on click of any button event

Hello Sir,

Please help us on Dyanmic adding of treetable data on click of any button event.

Check the next sample http://webix.com/snippet/8b27e18f

Hello Maksim,

On be half of Vikram, I will reply to this chain, this is very critical requirement we have, the example you have shown is fine, I will explain the issue with the same example,

I need one more sub tree under Video Tree, like you have Yoga, I need to add one more subtree like Dancing.So this will look like this.

Videos
–Dancing
-Folk Dance
-MJ Dance
-Local Dance

Please reply as soon as possible, because we are running out of time.

Hello Maksim,

If we can slightly change this requirement, then actully we want to add one more section like Dancing after Video, so the TreeTable will look like this.

Music
Images
Vedios
Dancing
-MJ Dance
-Local Dance

Check the updated snippet
http://webix.com/snippet/8914b373

You can use add command to create top item, and use id of top item in next commands to create sub items.

Hello Maksim,

Thanks for the updates,but still my problem is not solved, below is the snippet link which will let you my requirement.
http://webix.com/snippet/cf336054

If you see the snippet, you will find two Tree Regular Product and General Product Tree, now and under each tree I have added Products as a subtree,

Now My Requirement is, On Click of one button I need to add one or more product under Regular Product or Genral Product.

Suppose I want to add Product3 Under Regular Product Tree, now can you please let me know how I can add the newly created data in the existing tree.Product3 JSON will be having the data in the same way how Product1 is having.

I really need your help to solve this issue.

You can use something like next

      $$("treeId").ungroup();
      $$("treeId").parse([
            ... new data object here ...
      ]);

http://webix.com/snippet/a808138c

Thanks Makism,

Now the issue is resolved when I have taken the new webix.js (Version 8).

I have one more issue relates to the same , if you the http://webix.com/snippet/a808138c, there is an image (its a basically an link), the requirement is that , whenever user clicks on the link, I have to delete that particular tree from the TreeTable but other treetable data should be removed, this is same like above, like how we have added ‘Product3’, now I have to delete (Product3 ) .

Can you please help us on this, because this is going to be an critical face of the project and your help will really appreciable.

I have tried but I getting below error,

SCRIPT5011: Can’t execute code from a freed script
var parentNode = root.$$(“treeId”).getItem(delId);
The code where I am getting error is below line.
if(parentNode!=null && parentNode!=undefined && parentNode!=’’){}

Can you please help us on the above issue.

Thanks,
Raj

Check http://webix.com/snippet/7637c2b4

Hello Maksim,

The snippet is same, I see there is no change in this, i am really not able to understand any change in the snipet and if you see the above detailed question that I have given above, I am really looking for the solution for that.

Snippet is not the same. I have added the click processing code for delbtn

onClick:{
  "delbtn":function(e,id,trg){
        this.remove(id); //remove clicked branch from the tree
        return false;
   }
},