-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add aria-label to filter widget #1495
Comments
Hi @hijklmno! Good idea! Please let me know if there are any other ARIA labels that need to be added. |
In the master branch a new option was added: Notes:
Use it as follows:Default example:HTML <th data-label="First Name" class="filter-match">First</th> Script // ...
widgetOptions: {
filter_filterLabel: 'Filter "{{label}}" column by...';
}
// ... Resulting label: Complex example:HTML <th data-column-name="last name" data-ordinal-number="second" data-default-filter=", using a fuzzy search" data-label-extra="">
Last
</th> Script // ...
widgetOptions: {
filter_filterLabel: "Filter the {{column-name}}, the {{ordinal-number}} column{{label-extra}}{{default-filter}}";
}
// ... Resulting label: |
that is AWESOME. will wait for next update! thank you @Mottie! |
Hi, I tried above but I am not able to get the aria-Label on the text box and this is what it renders
I am not sure if we need to add any more configuration. This is what my configuration looks like var table = $(".js_applicant-list").tablesorter({
headerTemplate: "{icon} {content}",
cssIconNone: "column-sortable__link",
onRenderHeader: function(index) {
if (columnsWithoutSort.indexOf(index) > -1) {
$(this).find("a").removeClass("tablesorter-icon");
}
},
cssIconAsc: "column-sortable__link column-sortable__link--up",
cssIconDesc: "column-sortable__link column-sortable__link--down",
cssChildRow: "tablesorter-childRow",
sortList: [[columnIndexes.lastUpdated, 1]],
widgets: ["filter"],
widgetOptions: {
// If there are child rows in the table (rows with class name from "cssChildRow" option)
// and this option is true and a match is found anywhere in the child row, then it will make that row
// visible; default is false
filter_childRows: true,
// filter child row content by column; filter_childRows must also be true
filter_childByColumn: true,
filter_cssFilter: "tablesorter-filter",
filter_filterLabel: 'Filter "{{label}}"',
// Set this option to false to make the searches case sensitive
filter_ignoreCase: true,
// jQuery selector string of an element used to reset the filters
filter_reset: ".reset",
// Use the $.tablesorter.storage utility to save the most recent filters
filter_saveFilters: false,
filter_hideEmpty: true,
// Delay in milliseconds before the filter widget starts searching; This option prevents searching for
// every character while typing and should make searching large tables faster.
filter_searchDelay: 300,
// Set this option to true to use the filter to find text from the start of the column
// So typing in "a" will find "albert" but not "frank", both have a's; default is false
filter_startsWith: false,
filter_cellFilter: filterCellClassNames
}
}); |
Hi @debugguru! Is there a I set up this demo and it appears to be working. |
Thanks @Mottie . No we dont have data-label. I will try that now. Thanks for the response and example |
Hi Team,
Great tool! We use this in production as an internal tool for both sighted and blind individuals at our company.
It would be great to add
aria-label
to the filter input text fields, such as "Filter by...". Bonus points for appending the column name (from the body of the column'sth
).Let me know what you guys think!
The text was updated successfully, but these errors were encountered: