-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
EnableHistory and Urls issue #1584
Comments
Why do you have "index/index" in the URL ? Please post your url rules and the CGridView invocation. |
index/index is because it is a controller with only one action, both named index. i generally call just index and, as there's only one action and it is the default action, that action gets called. you see index/index because that's the full route (controller and action) and it lives inside a module. the relevant rules: (note that backend is a submodule of module users) 'rules' => [
'/users/index/index/<UsrsUser_page:\d+>' => '/users/index',
'/users/index/index/<UsrsUser_sort:\w+>' => '/users/index',
'/users/backend/<controller:\w+>/<id:\+>' => '/users/backend/<controller>', cgridview invocation: //note that the widget i actually instantiate is not cgridview per se but a subclass thereof. the only difference is an extra attribute, namely 'enableBootstrapFix' which is just used for presentation purposes. $this->widget('commonExtensions.widgets.MyCGridView.MyCGridView', array(
'id' => 'users-grid',
'dataProvider' => $model->search(),
'enableBootstrapFix'=>true,
'selectionChanged' => "function(id){window.location='" . Yii::app()->urlManager->createUrl('/users/view', array('id' => '')) . "' + $.fn.yiiGridView.getSelection(id);}",
'filter'=>$model,
'enableHistory'=>true,
'columns' => array(
array(
'name' => 'id',
'value' => '$data->id',
'htmlOptions' => array(
'style' => 'width:70px;'
),
),
'username'
)
)); |
I found the reason for this problem... It's in the $.deparam.querystring() method - cowboy/jquery-bbq#34 |
There was 2 problems here... first the above mentioned issue, and second the call When there is no |
Fixes #1584 CGridView enableHistory with "path" urlFormat [ci skip]
…t-relation-select * 'master' of https://github.com/yiisoft/yii: (144 commits) Fixes yiisoft#1567 Added filterSelector to CGridView Renamed the CONTRIBUTING file to CONTRIBUTING.md so that GitHub effectively uses the Markdown syntax already present in the file when presenting it. Fixes yiisoft#1694 - doc fix Added issue number fixed whitespace issues introduced with yiisoft#851 Updated CHANGELOG Fixes yiisoft#1584 same fix for CListView as already done for CGridView Fixes yiisoft#1344 same fix for CListView as already done in CGridView Fixes yiisoft#1104 same fix for CListView as already done for CGridView Fixes yiisoft#1676 - proper grouping when no group field is specified Added addPrimaryKey and dropPrimaryKey commands to CDbMigration class in response to enh req yiisoft#848 [messages/ja] yii.php updated csfix - thx @resurtm typo in changelog Reverted PR yiisoft#1467 (Issue yiisoft#1465, fixes related issue yiisoft#1661) Reverted PR yiisoft#1662 Better naming small update to documentation of filterAjaxOnly() Coding style fix Fixing bug yiisoft#1661 ... Conflicts: CHANGELOG
I have recently seen that it's possible to 'enableHistory' in a CGridView.
I use basic url rewriting and, for some reason, when I try and do pagination and sorting on a CGridView, even though the urls that get created are correct (I see that if I hover the mouse pointer over a pagination or a sorting link), when I click on it, my browser goes haywire.
Example:
url generated : https://localhost/sbce_backend/users/index/index/UsrsUser_page/2
(correct url)
upon clicking on the link:
https://localhost/sbce_backend/users/?/sbce_backend/users/index/index/UsrsUser_page/2=
I'm not sure this is a Yii issue at all but, when I removed 'enableHistory'=>true from my CGridView, everything started working again.
I've had this issue using:
Google Chrome Version 22.0.1229.94 on Ubuntu 11.04
Firefox 16.0.1 also on Ubuntu 11.04
Thanks you
FA
The text was updated successfully, but these errors were encountered: