Created
April 13, 2012 17:07
-
-
Save lsmith/2378404 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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