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

Row Detail plugin with grouping #654

Open
pkasik opened this issue Nov 9, 2021 · 9 comments
Open

Row Detail plugin with grouping #654

pkasik opened this issue Nov 9, 2021 · 9 comments

Comments

@pkasik
Copy link

pkasik commented Nov 9, 2021

I've been trying to implement the Row Detail plugin in a grid that also supports grouping.

What I've noticed is that when grouped, expanding a detail row will add several empty rows to the grid's DataView. This shows up as an additional group with rows (equal to the panelRows option in the Row Detail plugin).

If I disable these for loops in rowdetailview.js, it seems to fix the problem by preventing the items from getting added to the DataView...

for (var idx = 1; idx <= item[_keyPrefix + 'sizePadding']; idx++) {

for (var idx = 1; idx <= item[_keyPrefix + 'sizePadding']; idx++) {

However, disabling these also prevents the grid from recalculating the height, which means if you expand a row detail panel towards the end of the grid you will not be able to scroll down to view it.

Any thoughts on how we can recalc the height of the grid without adding rows? Will do some investigation and post any solutions if I find them.

@pkasik
Copy link
Author

pkasik commented Nov 9, 2021

Update, it also breaks moving rows beneath the expanded detail row. Bummer.

@pkasik
Copy link
Author

pkasik commented Nov 10, 2021

I've managed to get the Row Detail plugin working with grouping by tweaking slick.rowdetailview.js so that items added to the DataView copy over all the same values as the parent item, minus any fields that are used as aggregators within any groupings. Will post the updates here if anyone is interested...

@ghiscoding
Copy link
Collaborator

even better, create a Pull Request with your fix (if it doesn't break anything) and perhaps create a new Example to demo the use of both features in the same grid. I helped creating the Row Detail, though I haven't actually used it yet, so I can help reviewing your code.

@pkasik
Copy link
Author

pkasik commented Nov 11, 2021

Thanks, will do! I have one question regarding the plugin that I'm hoping you can shed some light on...

On line 565 in the getPaddingItem function it loops over the props in _grid.getData() and assigns each one as null to the item. I'm not sure what this is for, as all I can see is that all the methods of the DataView object get added to the item as null. Commenting this out doesn't seem to impact anything... so was just wondering if there was something I've been missing...

@ghiscoding
Copy link
Collaborator

hmm last commit on that line is 4 years ago, kinda hard to recall. If I remember correctly, I think it's because the data from the rows was showing up over the data (or with the data) and so assigning null to these rows (which are behind the row detail panel) is making sure that the row detail background is all cleared

@Berdmanfolk
Copy link

Does anyone have intermediate results?

@ghiscoding
Copy link
Collaborator

@Berdmanfolk let's put it this way, Row Detail & Grouping will most probably never be supported together. The reason is simple, they conflict with each other.

@Berdmanfolk
Copy link

But @pkasik in his pre last comment wrote that he made these two modules friends, or are not?

@ghiscoding
Copy link
Collaborator

ghiscoding commented Oct 1, 2023

@pkasik any chance we can get the code patch that you have made to bypass this problem? It would be very helpful for the project, if you could please provide just code that you used, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants