ember-a11y-datatable
v0.1.2
Published
An ember addon for an accessible data table.
Downloads
7
Maintainers
Readme
ember-a11y-datatable
Example of an accessible data table addon in Ember.
Based on this article
Demo
Installation
ember install ember-a11y-datatable
Usage
In your templates/components use the ally-datatable
component like this:
{{a11y-datatable
caption="Monthly Budget"
columns=columns
rows=rows
}}
In your component/controller initialize the table data like this:
export default Controller.extend({
columns: computed(function() {
return [
{
label: 'Month',
valuePath: 'month',
rowHeader: true
},
{
label: 'Amount Earned',
valuePath: 'earned'
},
{
label: 'Amount Spent',
valuePath: 'spent'
},
{
label: 'Amount Saved',
valuePath: 'saved'
}
];
}),
rows: computed(function() {
return [
{
month: "January",
earned: "$2500",
spent: "$1500",
saved: "500"
},
{
month: "February",
earned: "$2500",
spent: "$1500",
saved: "500"
}
];
})
});
Running Tests
npm test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit https://ember-cli.com/.