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

CollapseAll of ExpandRowColumn #407

Closed
pgyf opened this issue Nov 24, 2015 · 2 comments
Closed

CollapseAll of ExpandRowColumn #407

pgyf opened this issue Nov 24, 2015 · 2 comments

Comments

@pgyf
Copy link

pgyf commented Nov 24, 2015

If there is a double key, the value of data-key is as follows:
data-key= "A:2:{s:2: "Id" ; s:19:" 144703302436491058 "; payment_time" s:12: "; i:0;}"
The results are CollapseAll and expandAll do not work

Modify
https://github.com/kartik-v/yii2-grid/blob/master/ExpandRowColumn.php#L350
to
$detailOptions['data-key'] = is_object($key) || is_array($key) ? json_encode($key) : $key;

CollapseAll and expandAll can work,But does not show Loading


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@pgyf pgyf changed the title CollapseAll function of ExpandRowColumn CollapseAll of ExpandRowColumn Nov 24, 2015
@kartik-v
Copy link
Owner

json_encode will not work if the $key is an object - so it has to be serialized

@pgyf
Copy link
Author

pgyf commented Nov 24, 2015

If there are multiple primary keys in the table also can not work
$detailOptions['data-key'] = is_object($key) ? serialize($key) : (is_array($key) ? json_encode($key) : $key);

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