How to change the datasource on a YUI datagrid after creation
Posted
by Simon
on Stack Overflow
See other posts from Stack Overflow
or by Simon
Published on 2009-06-23T21:11:06Z
Indexed on
2010/03/08
18:36 UTC
Read the original article
Hit count: 732
I am using the Yahoo DataTable for which the API is here.
I am having difficulty changing the data once I have rendered the grid once. I am using jQuery to get data via AJAX, or from a client side data island and need to put this back into the grid.
There is no setDataSource method in the DataTable API, and changing 'dataSource.liveData' does not update the grid.
// does not work
dataTable.dataSource.liveData = [ {name:"cat"}, {name:"dog"}, {name:"mouse"};
The example I am basing my code on is the basic LocalDataSource example.
How can I update the data source without having to completely recreate the table. I do NOT want to use the YUI datasources that make Async calls. I need to know how I can do this 'manually'.
© Stack Overflow or respective owner