jquery easyui datagrid中使用combotree

hankaibo 2012-11-29 05:55:16
各位大侠,小弟具体问题如下:
前端页面用的是jquery easyui,后台用的是spring+json.
有一个功能就用datagrid展示数据,并且其中有一例用的是combotree.
我的combotree要实现异步加载,比如可以用下面的方法,

onBeforeExpand:function(node){
$('#cc').combotree("tree").tree("options").url= "treejson.aspxact=xx&pid=" + node.id;

现在的问题是我的这个方法是用在datagrid中的,我在datagrid中的columns中使用了editor,并制定它的类型是combotree.这样我在用上面的方法时,"#cc"是没有的,这种情况如何解决呢?
...全文
735 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
bbb332 2014-03-27
  • 打赏
  • 举报
回复
onBeforeExpand:function(n,o){ if (n){ $(this).tree("options").url = '<%=request.getContextPath()%>/sys/deptAction.do?action=queryLeaf&pid='+ n.id; } else { $(this).tree("options").url = '<%=request.getContextPath()%>/sys/deptAction.do?action=queryByID'; } }
lhl891111 2013-10-15
  • 打赏
  • 举报
回复
请问楼主怎么解决的?
bbb332 2013-08-30
  • 打赏
  • 举报
回复
想知道联系我。。。
bbb332 2013-08-30
  • 打赏
  • 举报
回复
居然不结贴。。。。。
寂寞的风铃 2013-08-05
  • 打赏
  • 举报
回复
var editor = $grid.datagrid('getEditor', { index: index, field: 'unit' }); var $combotree = $(editor.target); $combotree.combotree({ url: url + $.Guid.Empty(), onBeforeSelect: function (node) { if (!$(this).tree("isLeaf", node.target)) { return false; } }, onClick: function (node) { if (!$(this).tree('isLeaf', node.target)) { $combotree.combo("showPanel"); } }, onBeforeExpand: function (node) { $(this).tree("options").url = url + node.id; } });
chen5131421 2012-12-28
  • 打赏
  • 举报
回复
$('#cc')就是你定义中的ID <label for="org">组织机构</label> <select id="cc" name="sysOrg.id" class="easyui-combotree" style="width:200px;"/> <input id="orgId" name="orgId" type="hidden" value="$!{entity.sysOrg.id}"/> </p>

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧