Reputation: 62866
I am currently learning to use the YUI2 DataTable. (I will learn the YUI3 DataTable when it supports inline cell editing).
My question is simple - can I use it with the YUI3 DataSource or must I use YUI2 DataSource?
Upvotes: 1
Views: 201
Reputation: 1820
YUI 3 has began to implement inline-cell editing: http://blunderalong.com/yui/dta/editing/dt_cellediting.html Which will be put into the YUI-3 library in a couple weeks:
http://yuilibrary.com/gallery/show/datatable-celleditor-inline
Basically, hold tight for ~ 2 weeks and it will be done! I too have been using YUI 2 datatables since version 2.4 and have not yet moved to YUI 3 yet!
Upvotes: 0
Reputation: 2274
There is a module in the Gallery that wraps a YUI3 Data source with a compatibility layer to be used with YUI2 modules, in particular the DataTable. More information here:
http://yuilibrary.com/gallery/show/datasource-wrapper
I've used it in code that can be viewed here:
https://github.com/brianjmiller/interchange_mvc/blob/master/share/ic/js/renderer/v2_data_table.js
Upvotes: 1
Reputation: 924
You will have to provide a YUI2 DataSource when you create a DataTable instance if only to keep it happy. It might be a local datasource pointing to an empty array, but the YUI2 DataSource must be there. Later on, you may use any means you want to actually fetch the data and, once you have it, call onDataReturnInitializeTable which is what YUI2 does. You cannot provide a YUI3 DataSource in the constructor, they have different interfaces, DataTable would not know what to do with it.
Upvotes: 1