Skip to content
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

EditableColumn does not use $grid->options['id'] . '-pjax' for its pjaxContainerId #896

Closed
5 of 6 tasks
adamwinn opened this issue Apr 14, 2019 · 0 comments
Closed
5 of 6 tasks

Comments

@adamwinn
Copy link

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of yii2-grid.
  • This is not an usage question. I confirm having gone through and read the documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

In EditableColumn.php, it says

if ($this->grid->pjax && empty($this->_editableOptions['pjaxContainerId'])) {
	$this->_editableOptions['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id'];
}

but the docs say:

The pjax container identifier is read via pjaxSettings['options']['id'] . You could override and manually set pjaxSettings['options']['id'] if you need your own pjax container identifier. If not set this defaults to: $grid->options['id'] . '-pjax'

So if you dont manually set pjaxSettings['options']['id'] and rely on the default of $grid->options['id'] . '-pjax', your pjaxContainerId will not be set automatically like it's doing for $this->grid->pjaxSettings['options']['id']

I think there should be a check for this should be included. Something like:

if ($this->grid->pjax && empty($this->_editableOptions['pjaxContainerId'])) {
	if(empty($this->grid->pjaxSettings['options']['id'])) {
           $this->_editableOptions['pjaxContainerId'] = $grid->options['id'] . '-pjax';
        }        
        else {      
           $this->_editableOptions['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id']; 
       }
}

Then the people that rely in the default of $grid->options['id'] . '-pjax'; will automatically get their pjaxContainerId set just like they would if they specified $this->grid->pjaxSettings['options']['id']

  • jQuery version:
  • yii2-grid version: dev-master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants