user2660409
user2660409

Reputation: 85

YUI DataTable get total number records

I am new to YUI and I am using YUI 2 Datatable, I would like to alert if the total number of record is more than 4000 and not to render the table.

below is my piece of code.

this.myDataSource = new YAHOO.util.DataSource("<?php echo $html->url('/parser/dynload').'?params_array_serialized='.$params_array_serialized; ?>");

this.myDataTable = new YAHOO.widget.DataTable("gridbox", myColumnDefs,this.myDataSource, myConfigs);

I dont know how to get total number of record. Any one can help in this.

Upvotes: 0

Views: 366

Answers (1)

Devasatyam
Devasatyam

Reputation: 665

If I remember correctly, this.myDataTable would have a getRecordSet() method which returns a RecordSet object which is a where the DataTable stores its data. The RecordSet has a length (or perhaps it was count?) property or was it getLength() method. Anyway, regardless of the names which I cannot quite remember but the debugger will tell you, the RecordSet object is the key to it.

I do remember that the last build of the API docs for YUI went wrong and I believe the RecordSet object got accidentally dropped or misplaced so you won't find it there.

Upvotes: 0

Related Questions