Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by josh on Apr 27, 2009 20:36
open dhtmlx forum
customization questions (dataprocessor + tree)

Hello,

I have two questions:

1) grid allows for custom xml format...does dhtmlxtree also allows for such customization?

2) is it possible to customize the dataprocessor such that it follows a RESTful query format i.e:
instead of
/xmlFeed?!nativeeditor_status=update&gr_id=1234&a=1&b=2

we have something like
/xmlFeed/1234?a=1&b=2

3) one last small question: do you provide the source code for the demo applications? (I would be interested in the xml editor demo app)


Thank you,

j
Answer posted by Support on Apr 28, 2009 13:48
>>does dhtmlxtree also allows for such customization
Unfortunately there is no easy way to use different xml format with dhtmlxTree. Component will work only with predefined xml format.

>>2) is it possible to customize the dataprocessor such
In case of dhtmlxdataprocessor 2.1 you can use onBeforeDataSending , or just update lines 233-236 in dhtmlxdataprocessor.js

dp.attachEvent("onBeforeDataSending",function(id){
      dhtmlxAjax.get("/xmlFeed/"+id+"?"+dp._getRowData(id),function(loader){
          dp.afterUpdate(dp,null,null,null,loader);
      })
      return false;
})
Answer posted by Support on Apr 28, 2009 13:49
>> do you provide the source code for the demo applications
It possible if you have license for any of dhtmlx products - just contact sales@dhtmlx.com with such request.
Answer posted by josh on Apr 28, 2009 14:33
Hi ,

Thanks for the answers. I have one more to follow up:

2) Glad to see this new dp event in dp, but how can i detect whether the dp is doing an update/insert/delete?

1) for dhtmlxTree, how about serialization to JSON? can we serialize to JSON? is the serialization customization like grid?


Thakns again,

j
Answer posted by Support on Apr 28, 2009 14:38
>>can i detect whether the dp is doing an update/insert/delete?
Actually, event provides two parameters ( just missed it in above sample )

dp.attachEvent("onBeforeDataSending",function(id,state){

where state - string value which can be "updated", "deleted", "inserted"

>>1) for dhtmlxTree, how about serialization to JSON?
dhtmlxtree_json.js adds support for JSON serialization. It can be achieved with tree.serializeTreeToJSON();
>> is the serialization customization like grid?
There is no special supports for custom serialization, but tree provides methods, which allows to iterate through all items and save state in any custom format.