-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Gridview and DataProviders: Autoconfig sorting #809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
attribute:type:Header should also affect sort link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I use @inheritdoc here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should use @inheritdoc if possible to avoid duplicated documentation. Note I haven't used @inheritdoc until recently. So there are many places to be updated.
framework/yii/grid/DataColumn.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better not to modify $sort as it might be shared by other objects. We could enhance Sort::link() to support label option.
|
Okay, done here. Made all the changes as discussed. |
framework/yii/data/Sort.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, I think it's better we make "label" part of $options rather than a separate parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Gridview and DataProviders: Autoconfig sorting
|
Thank you! |
Gridview and DataProviders can now automatically recognize colums for sorting if they are not explicitly specified.
This gets a bit more convention over configuration feeling: