ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: aniket.kulkarni on June 06, 2014, 04:43:29 pm

Title: How to check grid has no rows?
Post by: aniket.kulkarni on June 06, 2014, 04:43:29 pm
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} );
Title: Re: How to check grid has no rows?
Post by: paramvir on June 06, 2014, 05:57:58 pm
Please check this post:

http://paramquery.com/forum/index.php?topic=606.msg3542#msg3542
Title: Re: How to check grid has no rows?
Post by: aniket.kulkarni on June 10, 2014, 06:40:04 pm
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).