0

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.

4

1 回答 1

0

如果我没记错的话,this.myDataTable会有一个getRecordSet()方法返回一个RecordSet对象,该对象是 DataTable 存储其数据的地方。有RecordSet一个length(或者可能是count?)属性或者它是getLength()方法。无论如何,不​​管我不太记得的名字,但调试器会告诉你,RecordSet对象是它的关键。

我确实记得 YUI 的 API 文档的最后一个版本出错了,我相信该RecordSet对象被意外丢弃或放错了位置,所以你不会在那里找到它。

于 2014-12-18T07:55:56.483 回答