JQuery EasyUI TreeGrid动态数据加载(JQuery EasyUI TreeGrid Dynamic Data Loading)

编程入门 行业动态 更新时间:2024-10-11 19:15:49
JQuery EasyUI TreeGrid动态数据加载(JQuery EasyUI TreeGrid Dynamic Data Loading)

我是jQuery的新手,我不太确定如何执行以下操作:

我正在使用EasyUI TreeGrid并希望显示动态数据,而不是从.json文件提供静态数据。 目前,我使用的代码如下:

$(function(){ $('#test').treegrid({ url:'treegrid_data.json',

等等。 相反,有没有什么办法可以直接传递ArrayList或bean对象?

提前致谢。

I'm new to jQuery and am not quite sure how to do the following:

I'm using EasyUI TreeGrid and want to display dynamic data rather than providing static data from a .json file. Currently, the code I'm using is as follows:

$(function(){ $('#test').treegrid({ url:'treegrid_data.json',

and so on. Instead, is there any way I can pass an ArrayList or bean object or something directly?

Thanks in advance.

最满意答案

而不是获取静态json文件..将网址指向您获得动态值的页面..说动态.php

url:'dynamic.php', ....

做你喜欢mysql连接的东西..或者在dynamic.php中获取动态数据并将其作为json返回....

dynamic.php

//do your stuff like getting dynamic datas in array.. $dynamicarray= $yourDynamicDataArray.. echo json_encode($dynamicarray);

这应该做...

Figured it out...instead of pointing to a static json file, specify the url as url: 'dynamic.jsp' or url: 'dynamic.java' pointing towards a jsp or servlet respectively(since we are developing a web application). In that page simply get the json string, say, as an attribute and print it using out.println(jsonString). Do not include any HTML tags whatsoever or you won't get the desired output.

更多推荐

I'm,bean,ArrayList,json,使用,电脑培训,计算机培训,IT培训"/> <meta name=&qu

本文发布于:2023-08-03 07:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1385384.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   动态   数据   TreeGrid   EasyUI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!