$(function(){ $('#dataGrid').datagrid({ nowrap: true, autoRowHeight: false, height:400, striped: true, collapsible:true, loadMsg:"数据加载中...", url:'${baseURL}/stuinfomge/stuinfomgeAction!ajaxSearch.action', loadFilter:function(data){ try { tempData = data.data.resultMap; } catch (e) { tempData=data; } return tempData; }, remoteSort:false, frozenColumns:[[ {field:'ID',checkbox:true} ]], columns:[[ {field:'STU_NAME',title:'学生姓名',width:120,sortable:true}, {field:'ORGANIZATION_NAME',title:'所属班级',width:120,sortable:true}, {field:'PARENT_NAME',title:'家长姓名',width:120,sortable:true}, {field:'CONCAT_PHONE',title:'联系电话',width:120,sortable:true}, {field:'CARD_NUM',title:'门禁卡号',width:120,sortable:true}, {field:'CONCAT_ADDRESS',title:'联系地址',width:240,sortable:true}, {field:'opt',title:'操作',width:200,align:'center', formatter:function(value,rec){ var rethtml=''; rethtml += "<span style=\"color:#08f;cursor:pointer;\" onclick=\"view('"+ rec.ID + "')\">查看</span>|"; rethtml += "<span style=\"color:#08f;cursor:pointer;\" onclick=\"editStuinfo('"+ rec.ID + "')\">修改</span>|"; rethtml += "<span style=\"color:#08f;cursor:pointer;\" onclick=\"rme('"+ rec.ID + "')\">删除</span>|"; return rethtml; } } ]], pagination:true, rownumbers:true, toolbar:[{ id:'btnadd', text:'新增', iconCls:'icon-add', handler:function(){ shoPanelWindow('addStuinfoDiv',900,550,'icon-add','新增学生信息'); } },'-',{ id:'btnclear', text:'删除', iconCls:'icon-clear', handler:function(){ var rows = getSelections(); rme(rows) } },'-',{ id:'btnimport', text:'批量导入', iconCls:'icon-import', handler:function(){ } }] }); var p = $('#dataGrid').datagrid('getPager'); $(p).pagination({displayMsg:"",beforePageText:"当前页",afterPageText:"总页数:{pages}", onBeforeRefresh:function(){ $('#dataGrid').datagrid("reload"); } }); }); function getSelections(){ var ids = []; var rows = $('#dataGrid').datagrid('getSelections'); for(var i=0;i<rows.length;i++){ ids.push("'" + rows[i].ID + "'"); } return ids.join(','); } function doSearch(){ $('#dataGrid').datagrid('loadData', { total: 0, rows: [] }); $('#dataGrid').datagrid('load',{ 'searchValue.stuname': ($("#stuname").val()), 'searchValue.orgid': ($("#searchorgid").val()) }); }