Closed pappfer closed 4 years ago
Thanks - the row expansion on INIT was intended to work by default with plain CSS (so no JS was needed to parse) - but if you are using ajax based rendering option for expanded detail (instead of normal render) it may not work. Will need to check this.
Yes, I'm using ajax based rendering.
This has been resolved with the latest commit (also has a related enhancement #948).
@kartik-v Sorry, but doesn't seem to work. It is complaining about an undefined variable at line 192.
TypeError: $detail.html(...) is undefined
@pappfer - I am not able to reproduce your issue - hope you have the latest assets loaded?
How are you configuring your ExpandRowColumn (are you using nested GridViews)?
I pushed in a commit. Can you retry and let know?
I don't get the console error now, but the row doesn't get expanded. I am not using nested GridViews. I am using a configuration mentioned in the first post along with 'detailUrl'.
I am unable to reproduce your issue. Currently to show this works fine - there is a new ExpandRowColumn demo enabled on the demos page. Refer the new expand row column demo. You can cross check the grid columns configuration by clicking the Grid Columns Setup button.
This has similar configuration with detailUrl
to render via ajax and selective rows expanded on INIT (in the example demo even numbered rows are configured to be expanded on init).
Let me know if you have something else on your environment or configuration which is missed.
It is really weird, because in my project sometimes it works, sometimes it doesn't. Sure, I am using the latest version and having the cache and the web/assets folder cleared. Unfortunately I don't have time to debug it now, for now I am using version 3.3.4 in my Composer and it works fine with that. When I'll get a little time, I'll investigate the issue.
@kartik-v I'm having the same issue, not sure about the cause but I think this should be reopened. I'll try to figure out more details about this tomorrow.
Got this issue too, but after clean my assets folder, it works again.
In our case it was conflicting with custom JS code of the project.
Prerequisites
master
branch of yii2-grid.This bug is similar to https://github.com/kartik-v/yii2-grid/issues/586 what I fixed earlier. I have this setting:
Even thought the
id
parameter is passed, the row won't open. The problem is caused by line 228-230 in kv-grid-expand.js:It occurs because
isExpanded
will be true whenGridView::ROW_EXPANDED
is set, so it ignores the rest of the javascript code and won't open the row. I currently don't have the chance to check why those lines are present so I can't create a pull request at the moment.