We are trying to make our applications compliant with the Web Content Accessibility Guidelines (WCAG) (https://www.w3.org/TR/WCAG20/). One of the requirements is that buttons have text associated with them.
When I created a grid (markup provided below), it fails WCAG compliance because the filter buttons in the column headers do not have text associated with them. I found a way to add the text into the span using javascript but it seems like there should be a better way.
Then I noticed that your demo grid (http://demos.telerik.com/kendo-ui/grid/filter-menu-customization) has the text property set. If I inspect the markup for one of the filter buttons in your demo, I see this:
<a class="k-grid-filter" href="#" tabindex="-1"><span class="k-icon k-filter">Filter</span></a>
So my question is...how did the text property of the span get the value "Filter"? And how can I accomplish that in my grid defined as follows:
@(Html.Kendo().Grid<Staff.Models.Employee>()
.Name("grdEmployees")
.Columns(columns =>
{
columns.Bound(p => p.FirstName).Width("9%").Title("First Name").Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains")));
columns.Bound(p => p.LastName).Width("9%").Title("Last Name").Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains")));
columns.Bound(p => p.OfficeDesc).Width("25%").Title("Office").MinScreenWidth(900).Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains")));
columns.Bound(p => p.WorkUnitDesc).Width("15%").Title("Work Unit").Filterable(f => f.Extra(false).Operators(o=> o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains"))).MinScreenWidth(900);
columns.Bound(p => p.EMail).Width("18%").Title("Email").Filterable(f => f.Extra(false).Operators(o=> o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains")));
columns.Bound(p => p.Phone).Width("8%").Title("Phone").Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains")));
columns.Bound(p => p.Title).Width("16%").Title("Title").Filterable(f => f.Extra(false).Operators(o=> o.ForString(s => s.Clear().Contains("Contains").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to").StartsWith("Starts with").EndsWith("Ends with"))).Cell(cell => cell.Operator("Contains"))).MinScreenWidth(900);
})
.ClientRowTemplate(
"<tr >" +
"<td >#: FirstName# </td>" +
"<td >#: LastName# </td>" +
"<td >#: OfficeDesc #</td>" +
"<td >#: WorkUnitDesc #</td>" +
"<td ><a href='mailto:#: EMail #' title='Send Email' alt='Send Email' >#: EMail #</a></td>" +
"<td style='white-space:nowrap;' >#: Phone #</td>" +
"<td >#: Title #</td>" +
"</tr>"
)
.ClientAltRowTemplate(
@"<tr class=""alt-row"" >" +
"<td >#: FirstName# </td>" +
"<td >#: LastName# </td>" +
"<td >#: OfficeDesc #</td>" +
"<td >#: WorkUnitDesc #</td>" +
"<td ><a href='mailto:#: EMail #'>#: EMail #</a></td>" +
"<td style='white-space:nowrap;' >#: Phone #</td>" +
"<td >#: Title #</td>" +
"</tr>"
)
.Pageable()
.Sortable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Staff_Read", "Staff"))
.Filter(f => f.AddRange(ViewBag.filters))
)
)
Thanks,
Ray