可按Ctrl+D收藏 蚂蚁资源网

蚂蚁资源网

easyui源码(easyui商业版)

  • 全部评论(3)
  • 售微星二开源码
  • treegrid.html<br>HTMLcode&lt;!DOCTYPEhtmlPUBLIC&quot;-//W3C//DTDHTML4.01Transitional//EN&quot;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;metahttp-equiv=&quot;Content-Type&quot;content=&quot;text/html;charset=UTF-8&quot;&gt;<br>&lt;title&gt;jQueryEasyUI&lt;/title&gt;<br>&lt;linkrel=&quot;stylesheet&quot;type=&quot;text/css&quot;href=&quot;../themes/default/easyui.css&quot;&gt;<br>&lt;linkrel=&quot;stylesheet&quot;type=&quot;text/css&quot;href=&quot;../themes/icon.css&quot;&gt;<br>&lt;scripttype=&quot;text/javascript&quot;src=&quot;../jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;<br>&lt;scripttype=&quot;text/javascript&quot;src=&quot;../jquery.easyui.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>$(function(){<br>$('#test').treegrid({<br>title:'TreeGrid',<br>iconCls:'icon-save',<br>width:500,<br>height:350,<br>nowrap:false,<br>rownumbers:true,<br>animate:true,<br>collapsible:true,<br>url:'treegrid_data.json',<br>idField:'code',<br>treeField:'code',<br>pagination:true,<br>frozenColumns:[[<br>{title:'code',field:'code',width:150}<br>]],<br>columns:[[<br>{field:'name',title:'Name',width:120},<br>{field:'addr',title:'Address',width:120,rowspan:2},<br>{field:'col4',title:'Col41',width:150,rowspan:2}<br>]],<br>onBeforeLoad:function(row,param){<br>if(row){<br>$(this).treegrid('options').url='treegrid_subdata.json';<br>}else{<br>$(this).treegrid('options').url='treegrid_data.json';<br>}<br>}<br>});<br>});<br><br>functionreload(){<br>$('#test').treegrid('reload');<br>}<br>functiongetChildren(){<br>varnode=$('#test').treegrid('getSelected');<br>if(node){<br>varnodes=$('#test').treegrid('getChildren',node.code);<br>}else{<br>varnodes=$('#test').treegrid('getChildren');<br>}<br>vars='';<br>for(vari=0;i&lt;nodes.length;i++){<br>s+=nodes[i].code+',';<br>}<br>alert(s);<br>}<br>functiongetSelected(){<br>varnode=$('#test').treegrid('getSelected');<br>if(node){<br>alert(node.code+&quot;:&quot;+node.name);<br>}<br>}<br>functioncollapse(){<br>varnode=$('#test').treegrid('getSelected');<br>if(node){<br>$('#test').treegrid('collapse',node.code);<br>}<br>}<br>functionexpand(){<br>varnode=$('#test').treegrid('getSelected');<br>if(node){<br>$('#test').treegrid('expand',node.code);<br>}<br>}<br>functioncollapseAll(){<br>$('#test').treegrid('collapseAll');<br>}<br>functionexpandAll(){<br>$('#test').treegrid('expandAll');<br>}<br>functionexpandTo(){<br>$('#test').treegrid('expandTo','02013');<br>$('#test').treegrid('select','02013');<br>}<br>&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;TreeGrid&lt;/h1&gt;<br>&lt;divstyle=&quot;margin:10px;&quot;&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;reload()&quot;&gt;reload&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;getChildren()&quot;&gt;getChildren&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;getSelected()&quot;&gt;getSelected&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;collapse()&quot;&gt;collapse&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;expand()&quot;&gt;expand&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;collapseAll()&quot;&gt;collapseAll&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;expandAll()&quot;&gt;expandAll&lt;/a&gt;<br>&lt;ahref=&quot;#&quot;onclick=&quot;expandTo()&quot;&gt;expandTo&lt;/a&gt;<br>&lt;/div&gt;<br><br>&lt;tableid=&quot;test&quot;&gt;&lt;/table&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;
  • 2021-02-22 02:45:01
  • 515680997
  • 后台返回 datagrid_data.json ;给个spring mvc 的例子供参考:package zjgs.eai.controller;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.ui.ModelMap;import org.springframework.web.bind.annotation.ModelAttribute;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import zjgs.comm.PageForDataGrid;import zjgs.eai.command.QuerySpErrorCommand;import zjgs.eai.service.EaiService;import javax.servlet.http.HttpServletRequest;@Controllerpublic class QuerySpErrorController { protected final Log logger = LogFactory.getLog(getClass()); @Autowired private EaiService eaiService; public EaiService getEaiService() { return eaiService; } //初始化 JSP 页面 @RequestMapping(value = "/eai/querySpError.htm", method = RequestMethod.GET) public String initPage(HttpServletRequest request) { request.setAttribute("querySpErrorCommand", new QuerySpErrorCommand()); return "eai/querySpError"; } //查询---返回对应的信息 @RequestMapping(value = "/eai/querySpSpxxByNsrsbh.json", method = RequestMethod.POST) public String getDataSetSpxx(@ModelAttribute("pojo") QuerySpErrorCommand querySpErrorCommand, ModelMap modelMap) { PageForDataGrid pageForDataGrid = new PageForDataGrid( this.getEaiService().getSpxxByXtsphm(querySpErrorCommand.getXtsphm()), 1, 100, modelMap ); pageForDataGrid.setDataGrid(); return "querySpSpxxByXtsphm.json"; } //查询---返回数据逻辑错误的日志信息 @RequestMapping(value = "/eai/querySpError.json", method = RequestMethod.POST) public String getDataSetErrorLog(@ModelAttribute("pojo") QuerySpErrorCommand querySpErrorCommand, ModelMap modelMap) { PageForDataGrid pageForDataGrid = new PageForDataGrid( this.getEaiService().getErrorLogByXtsphm(querySpErrorCommand.getXtsphm()), 1, 100, modelMap ); pageForDataGrid.setDataGrid(); return "querySpError.json"; }}
  • 2021-02-11 19:36:35
  • 至深科技
  • easyui 的rowspan colspan跨行跨列怎么不管用啊,代码写错了呗 上代码……easyui columns [[第一行],[第二行],[第三行]……] 每行field宽度要控制好否则也是显示有错
  • 2021-02-11 19:36:35
  • 商品推荐