General Category > ParamQuery Pro Evaluation Support
How to check grid has no rows?
(1/1)
aniket.kulkarni:
Hi!
I want to know how do I check if grid is empty or not before accessing the row from the grid?
//here if grid is empty then creates problem
var rowData2 = $gridMain.pqGrid( "getRowData", {rowIndx: 0} );
paramvir:
Please check this post:
http://paramquery.com/forum/index.php?topic=606.msg3542#msg3542
aniket.kulkarni:
Thanks first one worked.
var totalRecords = $grid.pqGrid('option', 'dataModel.data' ).length;
Second is having problem if grid has data then totalRecords are null but for empty it is 0 (zero).
Navigation
[0] Message Index
Go to full version