jquery easy ui 树的赋值问题。。
我从后台传回前台一个JSON型字符串或者是JSONObject对象、、在前台应该怎么赋值前台:<ulclass="easyui-tree"id="tt"></ul>后台传...
我从后台传回前台一个JSON型字符串或者是JSONObject对象、、在前台应该怎么赋值
前台:<ul class="easyui-tree" id="tt"></ul>
后台传到前台的值alert结果:
[{"id":"1","name":"当鲜","parent_id":"0","children":[{"id":"8","name":"原始山竹原料","parent_id":"1","children":[{"id":"9","name":"500g山竹包装产品1","parent_id":"8"},{"id":"10","name":"300g山竹包装产品2","parent_id":"8"},{"id":"11","name":"200g山竹包装产品3","parent_id":"8"}]},{"id":"2","name":"水果","parent_id":"1","children":[{"id":"4","name":"奇异果","parent_id":"2"},{"id":"5","name":"苹果","parent_id":"2"}]},{"id":"3","name":"蔬菜","parent_id":"1","children":[{"id":"6","name":"黄瓜","parent_id":"3"},{"id":"7","name":"白菜","parent_id":"3"}]}]}]
急 展开
前台:<ul class="easyui-tree" id="tt"></ul>
后台传到前台的值alert结果:
[{"id":"1","name":"当鲜","parent_id":"0","children":[{"id":"8","name":"原始山竹原料","parent_id":"1","children":[{"id":"9","name":"500g山竹包装产品1","parent_id":"8"},{"id":"10","name":"300g山竹包装产品2","parent_id":"8"},{"id":"11","name":"200g山竹包装产品3","parent_id":"8"}]},{"id":"2","name":"水果","parent_id":"1","children":[{"id":"4","name":"奇异果","parent_id":"2"},{"id":"5","name":"苹果","parent_id":"2"}]},{"id":"3","name":"蔬菜","parent_id":"1","children":[{"id":"6","name":"黄瓜","parent_id":"3"},{"id":"7","name":"白菜","parent_id":"3"}]}]}]
急 展开
1个回答
展开全部
//绑定数据
var zNodes = <%=json.ToString() %>
var zNodes = <%=json.ToString() %>
追问
用var node = $('#tt').tree('getChecked')获取了被勾选的节点。。我要取这个节点的id应该怎么获取?node.id取不到啊
追答
//单击
function onClick(e, treeId, node) {
// alert(node.id + ", " + node.name);
window.parent.mainFrame.location.href = "SetRight_Right.aspx&menu_id=" + node.id;
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询