我有一页,有两个网格视图。一键绑定并正确呈现数据表。另一个网格视图怎么也没有像他这样的渲染器。
这是我的网格视图代码: 第一个网格视图:
protected void egrd_PreRender(object sender, EventArgs e)
{
if (egrd.Rows.Count > 0)
{
egrd.UseAccessibleHeader = true;
egrd.HeaderRow.TableSection = TableRowSection.TableHeader;
}
}
protected void gvSubscribers_PreRender(object sender, EventArgs e)
{
if (gvSubscribers.Rows.Count > 0)
{
gvSubscribers.UseAccessibleHeader = true;
gvSubscribers.HeaderRow.TableSection = TableRowSection.TableHeader;
}
}
结果2:
这里出了什么问题,jquery datatable pulgin不适用于单个页面上的两个网格视图。
--------------------------------已更新----------- -------------------------
<script type="text/javascript">
$(function () {
$('[id$=egrd]').prepend($("<thead></thead>").append($('[id$=egrd]').find("tr:first"))).DataTable({
"responsive": true,
"sPaginationType": "full_numbers",
"bPaginate": true,
"bSort": true,
"iDisplayLength": 10,
"stateSave": true,
"stateDuration": 60 * 1
});
$('[id$=gvSubscribers]').prepend($("<thead></thead>").append($('[id$=gvSubscribers]').find("tr:first"))).DataTable({
"responsive": true,
"sPaginationType": "full_numbers",
"bPaginate": true,
"bSort": true,
"iDisplayLength": 10,
"stateSave": true,
"stateDuration": 60 * 1
});
});
</script>