EasyUI
1)异步加载机制的理解:实现局部无刷新加载
2)异步加载的具体实现:
前台入口:
$.ajax({
type:'post',
dataType:'json',
url:””,
data:params,
success:function(msg){
}
});
后台:
response.setContentType("text/json”;charset=UTF-8");
response.setCharacterEncoding("utf-8");
response.setHeader("pragma", "no-cache");
response.setHeader("cache-control", "no-cache");
PrintWriter out=response.getWriter();
out.println();//存入ajax队列
out.flush();//发送
out.close();//输出
二.Easyui
1)jquery-easyui简介
jquery-easyui是常用的jquery插件之一,利用它可以编写少量的js代码就能运行出比较华丽的js效果。
jquery-easyui是对强大的jquery一个简单封装,封装了一些特效和方法,我们直接调用这些方法并配置相应参数即可。
jquery-easyui主要用于界面的显示和特效几句简单的js代码既可以显示出比较简洁好看的特效。这里我们使用的是jquery-easyui-1.2.5。
使用jquery-easyui-1.2.5的准备:
jquery-easyui-1.2.5的使用必须引入的文件:
src="./js/jquery-1.7.1.min.js"> src="./js/jquery.easyui.min.js"> 引入js文件时注意顺序,顺序不对的话则没有效果。 顺序如下:显示基本jquery.js,然后是插件js 2)easyui-api 特性、事件、方法 事件: $('#id').menu(‘onShow’,function(){}); 方法:$(‘#id’).menu(‘show’,’left’); 3)easyui常用插件: Datagrid、dialog、accordin等 1. $("#id").datagrid({ url:path+" ", title:" ", queryParams:{ }, pageSize:20, striped:true, loadMsg:'数据加载中,请稍微...', remoteSort:false, columns:[[ { field:"id", checkbox:true, sortable:true }, { field:"zwmc", title:"职务名称", width:50 }, { field:"action", title:"操作", width:200, align:"center", formatter:function(value,rowData,rowIndex){ } } ]], pagination:true, rownumbers:true }); 2. $.messager.confirm("提示","确认保存?",function(val){ if(val){ $("#formid").form("submit",{ url:path+" ", success:function(returnData){ } }); } }); 3. $("#comboboxid").combobox({ url:path+" ", valueFi eld:’’, //key textField:' ' //value });