I'm looking for some help with dynatree plugin.
I need to transform the json coming from the server to make it dynatree compatible (I'm not allowed to do it on the server side),
This below apparently doesn't work:
initAjax: {
url: '/admin/tenant/jsontree',
data: {
tenantId: 1
},
success: function(data) {
// do modifications to the data returned from server
// and return formatted data
}
}
And I couldn't find a callback for it in the documentation. So my question is: is it possible to do that initial transformation with some callbacks or should I be looking for some other plugins?
Thank you in advance
Have a look at 'Loading custom formats' in the docs:
http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html
basically you can pass the standard $.ajax() options to initAjax(), such as dataFilter
.
(There is also a - yet undocumented - postProcess
callback option.)