Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created April 13, 2012 17:07
Show Gist options
  • Save lsmith/2378404 to your computer and use it in GitHub Desktop.
Save lsmith/2378404 to your computer and use it in GitHub Desktop.
// Adding a title attribute to a DataTable cell with a cellTemplate and a formatter
new Y.DataTable({
columns: [
{
key: 'foo',
allowHTML: true,
// Notice the lack of > before {content}
cellTemplate: '<td class="{className}"{headers} {content}</td>',
formatter: function (o) {
// the > is included in the cell content string returned from the formatter. allowHTML is required.
return 'title="' + value + '">' + value.slice(0, 5) + '...' + value.slice(-5);
}
},
...
],
...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment