Skip to content

Conversation

@cebe
Copy link
Member

@cebe cebe commented Aug 24, 2013

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:

  • auto fill sorting colums in ActiveDataProvider if none are configured
  • Lazy fallback of label creation via Inflector for Sort class (do it only in link creation method to allow setting label by other classes for example GridView)
  • Refactored DataColum to use model label or specified header for sorting link label

@ghost ghost assigned qiangxue Aug 24, 2013
Copy link
Member Author

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?

Copy link
Member

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) when pulling 3812165 on cebe:autoconfig-sorting into ac4b875 on yiisoft:master.

Copy link
Member

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.81%) when pulling 9847472 on cebe:autoconfig-sorting into ac4b875 on yiisoft:master.

@cebe
Copy link
Member Author

cebe commented Aug 26, 2013

Okay, done here. Made all the changes as discussed.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 39c002e on cebe:autoconfig-sorting into ac4b875 on yiisoft:master.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.85%) when pulling 53b4ed3 on cebe:autoconfig-sorting into ac4b875 on yiisoft:master.

qiangxue added a commit that referenced this pull request Aug 26, 2013
Gridview and DataProviders: Autoconfig sorting
@qiangxue qiangxue merged commit f48508e into yiisoft:master Aug 26, 2013
@qiangxue
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants