Yii DataView 1.3

Yii DataView version 1.3.0 was released. In this version:

  • Add GridView::keepColumnAttributesInEmptyCell() to keep column body cell attributes on empty cells
  • Add GridView::filterRowAttributes(), and filterAttributes and filterClass parameters to DataColumn to set HTML attributes and a CSS class for filter cells
  • Add GridView methods sortableHeaderClass(), sortableHeaderAscClass(), sortableHeaderDescClass(), sortableLinkAscClass() and sortableLinkDescClass() to configure CSS classes for sortable column headers and links
  • Add GridView::captionAttributes() method and $attributes parameter to GridView::caption() to set HTML attributes for the caption tag
  • Add OffsetPagination::currentLinkAttributes() and disabledLinkAttributes(), and KeysetPagination::disabledLinkAttributes() to set HTML attributes for the current page link or a disabled control, layered on top of linkAttributes()
  • Add BaseListView::accessibility() that opts into automatically added accessibility attributes: scope="col" and aria-sort on GridView header cells, scope="row" on row header cells, and aria-current, aria-disabled, aria-label and role="link" on pagination links — and a rowHeader parameter to DataColumn that renders the column's body cells as <th> row headers
  • Add ariaLabelNav(), ariaLabelFirst(), ariaLabelPrevious(), ariaLabelNext(), ariaLabelLast() and ariaLabelPage() methods to OffsetPagination, and ariaLabelNav(), ariaLabelPrevious() and ariaLabelNext() to KeysetPagination, to set aria-label on the nav container and page links
  • Add $accessibility, $translator and $translationCategory parameters to the PaginationContext constructor and to OffsetPagination::create() and KeysetPagination::create(), and a PaginationContext::translate() method
  • Make dependency container in GridView constructor optional
  • Render disabled KeysetPagination controls ("previous" on the first page, "next" on the last page) as span elements instead of a elements without an href
  • Render disabled OffsetPagination controls ("first"/"previous" on the first page, "next"/"last" on the last page) as span elements instead of clickable a elements
  • Keep GridView and column header cell attributes when a column renders no header