‘壹’ 用javascript 创建easyui datagrid 后台代码怎么写
后台返回 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;
@Controller
public 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";
}
}
‘贰’ Java项目用easyui做树形列表后台代码怎么来准备数据啊不要概括型答案,要详细过程的,谢谢!
教你怎么解决,下次就知道了.
http://www.jeasyui.net/demo/581.html
访问这个地址,是easyui的官网范例,可以看到范例的html里面有这个配置treegrid_data3.json
所以官方的代码用的是这个地址返回的json:http://www.jeasyui.net/demo/treegrid_data3.json.
访问上面的地址,返回值就是你要的:
{"total":9,"rows":[
{"id":1,"region":"Wyoming"},
{"id":11,"region":"Albin","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1},
{"id":12,"region":"Canon","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1},
{"id":13,"region":"Egbert","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1},
{"id":2,"region":"Washington"},
{"id":21,"region":"Bellingham","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2},
{"id":22,"region":"Chehalis","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2},
{"id":23,"region":"Ellensburg","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2},
{"id":24,"region":"Monroe","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}
],"footer":[
{"region":"Total","f1":14000,"f2":12600,"f3":13321,"f4":15281,"f5":14931,"f6":13461,"f7":14126,"f8":12866}
]}
‘叁’ Easyui在Datagrid里面显示HTML源代码
有个显示元数据的HTML标签:忘了名字。
‘肆’ 求一个jQuery的easyui做的年份下拉框代码,分没有很多啦,谢谢!
没太明白,是下拉框么?easyui提供的有这个控件.
$('#cc').combobox()
你是想年份自动生成么?
‘伍’ jquery easyui Buttons ,怎么悬浮有提示,title 不管用,是不是要改源码,怎么改啊,大神
你好,jquery easy ui 中悬浮提示是这样加的
<ahref="#"title="Thisisthetooltipmessage."class="easyui-tooltip">Hoverme</a>
需要用到easyui-tooltip 这个class,如果没有效果请引入jquery.tooltip.js
西裤可以解决你的问题
‘陆’ easyui combobox 显示问题 代码如下
这种不能亲自调试的,我也不是很清楚问题所在。我没遇见过(代码定位的话,那就是你把C标签删除了,写几个死的option,然后看页面会出现问题不,如果有问题就定义到C标签跟option会冲突)。相对之前的做法,combobox里面的值都是通过js获取:(根据你后端已经将值塞到集合instList里面,那么:)
$.("#schInstCodeTemp").combobox({
url:"";//后台那个方法的路径。
textField:instName;//value
valueField:instCode;//key
});
‘柒’ jquery easyui 控件是如何封装的,请简单示例代码方法
首先定义一个名字,如:mywidget-userlist,然后在需要的地方使用,如:
<input id="dd" class="mywidget-userlist" ></input>
在全局加载的公用脚本里,添加如下代码:
$("input.mywidget-userlist").live("click", function(evt){
alert("此处具体实现你要的效果,放你的大段代码。");
});
这样,以后你就不用重复那些代码了,而是只要在需要使用的input上加个class就能实现这样的效果了。
‘捌’ SpringMVC+mybatis+EasyUI权限 代码
var width = $(window).width()-80;
var height = $(window).height()-120;
stView_layout = $('#stView_layout').layout({
width: width,
height: height
});
station_view = $('#stationView').window({
title: '测站导航',
left:50,
top:80,
width: width,
modal: false,
shadow: false,
closed: true,
height: height,
onResize:function(w,h){
if(stView_treegrid){
stView_treegrid.treegrid({
width:w-20,
height:h-260
});
}
}
});
‘玖’ 使用easyui时,这样复杂的datagrid怎么实现,需要具体代码,跪求!!
easyUi datagrid设置行高度,在需要设置行高的table下添加样式就可以实现,这个设置只针对当前table,对别的table是没有影响的,具体代码如下: #g .datagrid-btable tr{height: 40px;}
‘拾’ jfinal+easyui项目源码
JFinal是一个基于Java的极速Web开发框架,其核心设计目标是开发迅速、代码量少、学习简单、功能强大、轻量级、易扩展、Restful。
地址:http://www.csdn.net/tag/jfinal