Eamon Brosnan![]()
This patch fixes the following issues:
The {value} token remains because Y.substitute does not delete invalid tokens. In this fix a function has been
supplied to substitute to replace invalid tokens with a zero length string.
The patch does not require any additional code, you just need to include it in your use statement.
The source comes with a testing suite to show the issue and allows you to run a test with or without the patch loaded.
YUI().use('gallery-user-patch-2529920-2529921', function(Y) {
var mockresponse = {
response: {
results: [
{ "id" : "1", "name" : "Joe" },
{ "id" : "2", "name" : null }, // this null will now be rendered as an empty string
{ "id" : "3", "name" : "Andrew" }
]
}
};
var dt = new Y.DataTable.Base({
columnset : [
{ key:"id", sortable: true, formatter: fnFormatterWithAccessToTD }, // this formatter will now receive the td reference as per the documentation
{ 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