Categories | Question details Back To List | ||
problems with tree custom data and data processor We use custom data with dhtmlx tree, and encountered a problem with data processor. It seems, that it can't pass any additional data back to the tree after insert (or update) operation. It can only get the custom data from GET request, but can't return it via XML back to the script. Is it possible? If not, do you plan to add support for custom data for data processor? We try to workaround this problem with tree reloading, but it is sometimes unefficient, and would be unnecessary if only data processor could pass the custom data back to the tree. Thanks Answer posted by Support on Dec 11, 2008 07:31 >>Is it possible? The events of dataprocessor can be extended, please check next articel ( it purposed for the grid, but dataprocessor logic are very similar for both components ) http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Dataprocesor_usage.html#grid_art_dataprocessor "Custom server side responses" describes how custom response types can be used. Instead of fully custom response you can extend existing one. For example for insert operation , your server side code may generate next response <data> <action type="insert" sid="oid" tid="nid" custom="anything"> </data> and on client side dp.defineAction("update",my_action) function my_action(node){ alert(node.getAttribute("custom")); return true; // allow default update processing } such logic allow to send any kind of additional data from server back to client and assign the logic which will fire when response received. same can be used for "update" and "delete" response types Answer posted by smolki on Dec 16, 2008 09:16 Ok, that works, but I do not see defineAction function in the docs. I just can't find it, or it is not there? How do I find that function (and possibly others) in the documentation? Answer posted by Support on Dec 16, 2008 09:38 It is described in related article http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Dataprocesor_usage.html#grid_art_dataprocessor This method doesn't listed in API reference of dhtmlxgrid , because it quite specific and not necessary for common usage of the dataProcessor. |