Refresh grouped TreeTable

edited March 2019 in Technical questions

I have a treetable that is grouped into a hiererchy. The user has the option to change the name of one of the parent levels. How can I refresh the data in the treetable to reflect this name change and maintain the grouping?

I have tried and failed with:

treetable.clearAll();
treetable.load(xxx.php);

Strange thing is that if I force the php file to have just 1 line in it, that line appears as 1 row in the treetable. If I try 2 manually created rows, it fails ie. blank treetable.

Comments

  • Hello,
    Try to use updateItem.
    If the grouping is server-based, in other words, the data structure arrives as a tree, so the id of the item will be known and it makes a possibility to update the item.
    If the grouping is made via our method, so using id will be not so comfortable. There is better to use

    let id = treetable.data.getParentId("child_item");
    treetable.updateItem(id, { name:"New name" });
    

    Strange thing is that if I force the php file to have just 1 line in it, that line appears as 1 row in the treetable. If I try 2 manually created rows, it fails ie. blank treetable.

    Could you please send a sample where I can see what exact arrives from the server? Or is better will be to see a snippet of the code

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion