Sorting

Больше
2 мес. 3 нед. назад #6081 от admin
admin создал тему: Sorting
To use yii\data\Sort, first declare which attributes can be sorted....

Sorting

When displaying multiple rows of data, it is often needed that the data be sorted according to some columns specified by end users. Yii uses a [[yii\data\Sort]] object to represent the information about a sorting schema. In particular,

  • [[yii\data\Sort::$attributes|attributes]] specifies the attributes by which the data can be sorted. An attribute can be as simple as a model attribute. It can also be a composite one by combining multiple model attributes or DB columns. More details will be given in the following.
  • [[yii\data\Sort::$attributeOrders|attributeOrders]] gives the currently requested ordering directions for each attribute.
  • [[yii\data\Sort::$orders|orders]] gives the ordering directions in terms of the low-level columns.
Подробнее...