第一种:直接绑定数据源。
<table id="dgbuild" title="" class="easyui-datagrid"
url="${pageContext.request.contextPath}/queryAllDormitory"
style="width: 100%; height: 450px; overflow: scroll;"
toolbar="#toolbar" pagination="true" rownumbers="true"
fitColumns="true" singleSelect="true">
<thead>
<tr>
<th field="id" hidden="true"></th>
<th field="buildName" style="width: 20%;">宿舍楼名称</th>
<th field="sex" style="width: 15%;">类型名称</th>
<th field="total" style="width: 20%;">宿舍容量</th>
<th field="remainder" style="width: 20%;">剩余量</th>
<th style="width: 20%;"
data-options="field:'aaa',width:50,align:'center',formatter:formatOper">分配宿舍</th>
</tr>
</thead>
</table>
<table id="dgbuild" title=""