[TREEGRID] Refresh branch (as tree)

Dear Sir,



I’m currently working on a treegrid filled at first by a provided xml.

At some point, I have to update a part of this treegrid from a generated xml.

It basically replace old infos of a branch by a new ones.

In DHTMLXTREE, I’d have used a very useful method :

smartRefreshBranch(…) or , at least, refreshItem(itemId).



Unfortunatly, in DHTMLXTREEGRID, It seems that only method available for that kind of process is :

updateFromXML(…)

Which doesn’t do the same thing (and mess with treegridline but that’s a seperate matter…).



Any thoughts ?

Which doesn’t do the same thing (and mess with treegridline but that’s a seperate matter…).
Actually it can be used to update values in treeGrid but only for single branch ( it equal to smartRefreshItem in dhtmlxtree ) - so if you will load in server side response xml for single branch - it will be correctly updated.


>>at least, refreshItem(itemId).


The same effect can be reached by
    grid.deleteChildItems(id);
    grid.loadXML(“some.url?for=”+id);



>>Actually it can be used to update values in treeGrid but only for single branch ( it equal to smartRefreshItem in dhtmlxtree )

Indeed, updateFromXML is the first thing I tried out. But thing is, it doesn’t exactly equal to smartRefreshItem.

When you’re using this method, you have two booleans params ‘insert_new’ and ‘del_missed’, like the following line :
myTreeGtrid.updateFromXML(urlwhichrebuildXMLbranch , insert_new , del_missed , aftercall);

In my case I need a full update, which means cells AND rows have to be updated (deleted,inserted…). So I put those params both on ‘true’.
Unfortunatly, when I do this, It clears all rows of treegrid except ones I’d provided in the XML.
This not so surprising after all, as this method seems to have been writen in order to enhance speed over a full reload (ClearAll(), then loadXML) and
,as I’m only providing the updated branch in my XML file and ‘del_missed’ param is on, it does what it is asked.
However, It differs from smartRefreshBranch which tries to fully update (i.e : replace a part of the tree by another) without deleting all other nodes.
In the attached images, you could find a visual sample of what I’m trying to achieve without passing through a full reload.

I also tried :
   grid.deleteChildItems(id);
   grid.loadXML(“some.url?for=”+id);
But It breaks treegrid : After update done, Branch root node doesn’t have anymore open/close icon.









Please contact us directly at support@dhtmlx.com and provide your reference number, we may send you dev. version of code which has full support of updateFromXML in TreeGrid mode.

After upgrade to 1.6 version,  behaviour changed back to previous.
Issue re-opened.

Current code :

reportGrid.updateFromXML(xmlfile,true,true,someAfterFunc);

Input XML :


Darques Nicolas
4.25
   
Projets
   
BLOOD_RND
3.75
115453

   
MASCARADE
0.50
116698


   
Contrats
   
1 : BLOOD_RND
3.75
115453
02/06/2008
03/06/2008
Jour

   
2 : MASCARADE
0.5
116698
03/06/2008
03/06/2008
Jour




See images in attachments for result.









Regression confirmed and fixed, updated js file sent by email.

Fixes tested. Works perfectly. Thanks.