Eamon Brosnan![]()
The DataTableDataSource plugin creates a new instance of Y.RecordSet when data returns from DataSource.
This causes the RecordSet to lose its plugins and instance specific configuration. This breaks DataTableSort and potentially other datatable plugins that rely upon recordset plugins.
The patch fixes this by cloning the recordset and then setting the values (cloning forces the recordsetChange event to occur).
You don't need to change your code at all to use this patch. Just make sure you include it in your YUI().use statement.
YUI().use('gallery-user-patch-2529975', function(Y) {
var mockresponse = {
response: {
results: [
{ "id" : "1", "name" : "Joe" },
{ "id" : "2", "name" : "Andrew" }
]
}
};
var dt = new Y.DataTable.Base({
columnset : [
{ key:"id", sortable: true },
{ key:"name", sortable: true }
],
summary : "User patched DataTable Instance",
recordset : mockresponse.response.results
});
dt.render('#example');
});
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info