判断gridView是否有数据

我这里的gridView是采用空模板数据来显示的

当gridView的数据源为空的时候它们就会显示标题

有数据的显示它们就会显示下面的这种

你仔细观察会发现,当有数据的时候空标题的table没有了,解释的出来的html就如上面所示

 var title_leng= $("#gridOrder tr table tr").length;//如果为1表示grid无数据,如果为0表示有数据
     if(title_leng<=0)
     {
        alert('GridView有数据');


     }
     else
     {
         alert('GridView没有数据');
     }

原文地址:https://www.cnblogs.com/yzenet/p/3379905.html