使用js指定表格属性时,表格html中的table就只需要一个ID,不能设置class,要不然在框架页中加载时会访问两次数据源
(document).ready(function () {(‘#tt’).datagrid({
url: ‘/operator/list’,
rownumbers: true,
idField: ‘id’,
striped: true,
singleSelect:true,
collapsible:true,
onSelect: function (rowIndex, rowData) {
setsel(‘tt’, ‘sel’, rowIndex, true);
}
});
});
<table id="tt" >
<thead>
<tr>
<th data-options="field:'edit',width:50" align="center"></th>
<th data-options="field:'operator',width:80">登录名</th>
<th data-options="field:'rights'">权限</th>
</tr>
</thead>
</table>