treegrid动态加载
web前端-js教程
废话不多说了,直接给大家贴代码了。在线源码生成器,vscode如何清理,ubuntu xargs,tomcat 挂起分析,sqlite3 标准库,thinksns 登录插件,前端托拉拽功能框架,昆明爬虫技术费用高吗,php curl 超时,深圳优化seo工具,招聘手机网站源码,js插件获取网页内容,织梦博客模板下载lzw
具体代码如下所示:微信助力投票 源码,vscode联想插件,ubuntu 二进制查看,网络tomcat,kotlin连接sqlite,网站服务器租用协议,页签插件,java前端注入框架,速卖通爬虫软件,php学习什么,培训seo优化的学校,简单大气网站模板,网页图片转圈,易企秀我的模板,银行前台页面html源码,餐厅管理系统毕业设计,易语言取子程序指针lzw
1、前端php医疗预约网站源码,ubuntu安装方式区别,tomcat7 破解密码,爬虫python抓取工具,php图片加文字水印和背景,seo优化贵州lzw
$(function() {$('#goods_type_treegrid').treegrid({url : '${pageContext.request.contextPath}/admin/goodsTypeController/treegrid.do?id=NULL',idField : 'id',treeField : 'text',rownumbers: true,parentField : 'pid',fit : true,fitColumns : true,border : false,frozenColumns : [ [ {title : '编号',field : 'id',width : 150,hidden : true}, {field : 'text',title : '类别名称',width : 200} ] ],columns : [ [ {field : 'pname',title : '上级类别名称',width : 80},{field : 'seq',title : '排序',width : 50},{field : 'code',title : '类别编码',width : 50}, {field : 'pid',title : '上级类别ID',width : 150,hidden : true}, {field : 'action',title : '动作',width : 50,formatter : function(value, row, index) {return formatString(' ', row.id, '${pageContext.request.contextPath}/style/images/extjs_icons/pencil.jpg' alt="Treegrid的动态加载实例代码【jquery】" title="Treegrid的动态加载实例代码【jquery】", row.id, '${pageContext.request.contextPath}/style/images/extjs_icons/cancel.jpg');}} ] ],toolbar : [ {text : '批量导入',iconCls : 'icon-remove',handler : function() {goods_type_importFun();}},{text : '增加',iconCls : 'icon-add',handler : function() {goods_type_appendFun();}}, '-', {text : '展开',iconCls : 'icon-redo',handler : function() {var node = $('#goods_type_treegrid').treegrid('getSelected');if (node) {$('#goods_type_treegrid').treegrid('expandAll', node.cid);} else {$('#goods_type_treegrid').treegrid('expandAll');}}}, '-', {text : '折叠',iconCls : 'icon-undo',handler : function() {var node = $('#goods_type_treegrid').treegrid('getSelected');if (node) {$('#goods_type_treegrid').treegrid('collapseAll', node.cid);} else {$('#goods_type_treegrid').treegrid('collapseAll');}}}, '-', {text : '刷新',iconCls : 'icon-reload',handler : function() {$('#goods_type_treegrid').treegrid('reload');}} ],onBeforeExpand:function(row){//动态设置展开查询的url var url = '${pageContext.request.contextPath}/admin/goodsTypeController/treegrid.do'; $("#goods_type_treegrid").treegrid("options").url = url; return true; },onContextMenu : function(e, row) {e.preventDefault();$(this).treegrid('unselectAll');$(this).treegrid('select', row.id);$('#goods_type_menu').menu('show', {left : e.pageX,top : e.pageY});},onExpand : function(row){var children = $("#goods_type_treegrid").treegrid('getChildren',row.id);if(children.length<=0){row.leaf=true;$("#goods_type_treegrid").treegrid('refresh', row.id);}}});});
@RequestMapping("/treegrid")@ResponseBodypublic List treegrid(GoodsTypePage goodsTypePage) {if(null==goodsTypePage,| "".equals(goodsTypePage.getId()),| null == goodsTypePage.getId()){goodsTypePage.setId("NULL");}return goodsTypeService.treegrid(goodsTypePage);}3、service
@Override// 缓存数据public List treegrid(GoodsTypePage goodsTypePage) {String hql = "";if(null==goodsTypePage,| "".equals(goodsTypePage.getId()),| "NULL".equals(goodsTypePage.getId())){hql = "from GoodsType t where t.tgoodstype.id is NULL order by t.seq";}else{hql = "from GoodsType t where t.tgoodstype.id = '" +goodsTypePage.getId()+"' order by t.seq";}List brList = goodsTypeDao.find(hql);List nl = new ArrayList();if (brList != null && brList.size() > 0) {for (GoodsType br : brList) {GoodsTypePage r = new GoodsTypePage();BeanUtils.copyProperties(br, r);if(br.getTgoodstype()!=null){r.setPname(br.getTgoodstype().getText());r.setPid(br.getTgoodstype().getId());}r.setState("closed");nl.add(r);}}return nl;}