CGridView Accessibility Compliance

CGridView is currently not compliant with accessibility guidelines, which are mandatory for some applications. The requirements for data tables is here.

CGridView currently does not:

  • identify row header cells - i.e. the first cell in a row is a <th/> (11.1)

  • and consequently, provide for the scope attribute in the row header cells (11.1)

  • support adding a summary to the items table (11.3)

Headers in data cells can be used, but requires that the id of each column is known - it can be set, but the proposed solution means this is not necessary and you can leave it to CGridView to create column ids for you.

I’ve rasied a ticket with some ideas to address all the issues above. CGridView will work as it does now with the addition of the scope attribute being set on column header cells. To put it into accessibility compliance mode, setting CGridView::itemsHtmlOptions will allow the table to have attributes - including summary, and setting CGridColumn::htmlOptions[‘headers’] to a non-empty value will create a <th/> for the first data cell of each row and set the headers attribute for all data cells; so making CGridView fully compliant with all accessibility requirements.