Hi Ilya
Zlochisty,
Greetings
from Syncfusion support.
Based on the
information provided, it has been noted that you intend to announce the states
of checkboxes displayed in columns where the `displayAsCheckBox`
property is enabled within the Grid. Since the checkboxes within these columns
are rendered in a disabled state, they are not included in the default tab
navigation, causing their states to remain unannounced by screen readers. To
overcome this, an `aria-label` has been assigned to the `<td>`
elements containing these checkboxes utilizing the `queryCellInfo `
event of the Grid. This ensures that their states are announced properly by the
screen readers. For further details, please refer to the example code and the
accompanying sample provided below.
App.js
const queryCellInfo = (args) => {
if (args.column.displayAsCheckBox) {
const checkedState = args.data[args.column.field] ? 'Checked' : 'Unchecked';
args.cell.setAttribute('aria-label', checkedState);
}
};
<GridComponent dataSource={data.slice(0,5)} queryCellInfo={queryCellInfo}>
<ColumnsDirective>
<ColumnDirective field='OrderID' headerText='Order ID' width='100' textAlign="Right" type='number' />
<ColumnDirective field='Verified' headerText='Verified' width='100' type='boolean' displayAsCheckBox={true} />
…………………………
</ColumnsDirective>
</GridComponent>
|
Sample: https://stackblitz.com/edit/react-6lfnqvin-zmznk2cf?file=App.js,datasource.ts
API
Reference: QuerycellInfo
If you need any other assistance or have additional
questions, please feel free to contact us.
Regards,
Aishwarya R