-
Notifications
You must be signed in to change notification settings - Fork 75
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
when use EMongoSort with EMongoDataProvider, not act as like CSort with CActiveDataProvider #254
Comments
So you're saying that * is supposed to? Can you link documentation for that? |
These code take no effect. Or I want to know how to custom some attributes be sortable in CGridView. |
Oops, I forgot all about this. It will take me sometime to test this since I have not checked out my MongoYii test repo in a long time (haven't used Yii1 in like a year so far) so I will need more time to find some spare time to work on this. |
@Sammaye Thanks for your reply. Does you have moved to yii2? |
Indeed I am totally on Yii2 these days |
Ok, I finally got round to this and I notice that the code to sort by * does exist. Can you clarify what you mean by "But It doesn't done as the CSort do." can you tell me what the response is? What attributes are sortable? |
Sammaye/MongoYii#254 to see if it works init
Seems to work for me in my test repo: https://github.com/Sammaye/MongoYii-test/blob/master/protected/views/user/index.php#L30 despite the group field being sortable without defining any attributes in the data provider once I did it became unsortable: https://github.com/Sammaye/MongoYii-test/blob/master/protected/models/User.php#L86 and a default order was applied |
It does not take effected. |
OK that's done now, tested. |
I update to this fix version, the bug is fixed. But I found a new bug.
the following code not run like as before:
|
Are you defining the columns in your widget like so: <?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'_id',
'username',
'email',
'group',
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
),
),
)); ?> ? I have found out that if you define the columns then you must define the names for some odd reason. It comes down to the contents of CGridView:
So it seems this is a framework problem not an extension problem. |
I want only startTime and endTime attributes be sortable in CGridView. But It doesn't done as the CSort do.
The text was updated successfully, but these errors were encountered: