前端你可以选择Extjs,easyui等组件,然后通过组件里的东西,调用后台。
用easyui的前端:
<div id="test"></div>$('#test').datagrid({
columns: [[
{field:"a",title:'a',width:90,align:'center',sortable:true},
{field:"b",title:'b',width:90,align:'center',sortable:true},
{field:"c",title:'c',width:90,align:'center',sortable:true},
{field:"d",title:'d',width:90,align:'center',sortable:true},
{field:"e",title:'e',width:90,align:'center',sortable:true},
]],
singleSelect: true,
rownumbers : true,
loadMsg :'加载中....',
autoRowHeight: false,
pagination:true,
pageSize : 20,
sortName:sortName,
sortOrder:"desc",
fitColumns:true,
url: appName+'/testAction.do?method=test'
})
后台:
public class testAction{private testService service
public testAction(testService service){
this.service = service
}
public ActionForward test(ActionMapping mapping, ActionForm form,HttpServletRequest request,
HttpServletResponse response) throws IOException{
int page=Integer.parseInt(request.getParameter("page"))-1
int rows=Integer.parseInt(request.getParameter("rows"))
int start = page*rows
int limit = rows*(page+1)
List datas = service.queryTable(start,limit,sort,dir)
int total = service.queryTableTotal()
String strJson = GsonUtils.list2Json(datas,total)
returnJson2Web(response , strJson)
return null
}
}
'确定要删除<span style="color:redfont-weight:bold">'+obj.userName+'</span>吗?'这样直接当做HTML代码拼写就行了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)