Dynatree - 如何转换来自服务器的 json?
我正在寻找有关 dynatree 插件的帮助。
我需要转换来自服务器的 json 以使其成为动态树 兼容(我不允许在服务器端执行此操作),
下面的这显然不起作用:
initAjax: {
url: '/admin/tenant/jsontree',
data: {
tenantId: 1
},
success: function(data) {
// do modifications to the data returned from server
// and return formatted data
}
}
而且我在文档中找不到它的回调。 所以我的问题是:是否可以用一些东西来进行初始转换 回调还是我应该寻找其他一些插件?
先感谢您
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看文档中的“加载自定义格式”:
基本上,您可以将标准 $.ajax() 选项传递给 initAjax(),例如
dataFilter
。(还有一个尚未记录的
postProcess
回调选项。)Have a look at 'Loading custom formats' in the docs:
basically you can pass the standard $.ajax() options to initAjax(), such as
dataFilter
.(There is also a - yet undocumented -
postProcess
callback option.)