https://www.myziyuan.com/
- 售微星二开源码
- treegrid.html<br>HTMLcode<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><br><html><br><head><br><metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"><br><title>jQueryEasyUI</title><br><linkrel="stylesheet"type="text/css"href="../themes/default/easyui.css"><br><linkrel="stylesheet"type="text/css"href="../themes/icon.css"><br><scripttype="text/javascript"src="../jquery-1.4.2.min.js"></script><br><scripttype="text/javascript"src="../jquery.easyui.min.js"></script><br><script><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<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+":"+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></script><br></head><br><body><br><h1>TreeGrid</h1><br><divstyle="margin:10px;"><br><ahref="#"onclick="reload()">reload</a><br><ahref="#"onclick="getChildren()">getChildren</a><br><ahref="#"onclick="getSelected()">getSelected</a><br><ahref="#"onclick="collapse()">collapse</a><br><ahref="#"onclick="expand()">expand</a><br><ahref="#"onclick="collapseAll()">collapseAll</a><br><ahref="#"onclick="expandAll()">expandAll</a><br><ahref="#"onclick="expandTo()">expandTo</a><br></div><br><br><tableid="test"></table><br><br></body><br></html>
- 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