thank you so much. it works.
2008/8/20, Lucas Smith <lsmith@...>:
> --- In ydn-javascript@yahoogroups.com, WongTseng
> <wangzengverycool@...> wrote:
>>
>> I've used datatable on a search panel, using pagination function.
>> When user closes the search panel, I want to clear all the data
>> received from the server, and the pagination links. I use the
>> deleteRecords method to remove all the records, but I can not clear
>> the pagination links. Even I call the destroy method on the paginator,
>> when the search panel is displayed again, the pagination links are
>> still there. How can I solve this problem?
>>
>> --
>> Thanks
>> Wong Tseng
>>
>
> You should be able to use the DataTable's initializeTable() method to
> clear all rows. Incidentally, there is a bug (omission, really)
> whereby initializeTable doesn't update the Paginator's totalRecords
> attribute. This is fixed in the upcoming 2.6 version. You can patch
> this via
> myDataTable.initializeTable = function () {
> this.get('paginator').set('totalRecords',0);
> YAHOO.widget.DataTable.prototype.initializeTable.call(this);
> };
>
> In your case, I would look at the Paginator's alwaysVisible attribute
> if you don't want to display pagination controls unless there is
> reason to.
>
> Hope this helps,
> Luke
>
>
--
Best Regards
Wong Tseng