什么被认为是确定是否有行绑定的最佳做法?检测Telerik ASP.NET MVC Grid中的0行
目前,我使用类似于下面的客户端OnDataBound事件,代码:
gridDataBound: function (event)
{
var rows = $('tbody tr:has(td)', this);
if (rows.length == 0 || (rows.length == 1 && rows[0].innerText == "No records to display'))
$('#GridSection').hide("slow");
}
有一定是一个更好的办法!
除非有没有记录。在这种情况下,`data`是未定义的 – kdawg 2012-06-18 21:27:18