-
Notifications
You must be signed in to change notification settings - Fork 404
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
Option to Keep Rows Expanded in Grouped Tables #704
Option to Keep Rows Expanded in Grouped Tables #704
Conversation
This solution makes sense and the code looks good (have not ran locally yet), but it would be good to document this as well. Can you add documentation in with this PR |
enabled: true, | ||
collapsable: true | ||
}" | ||
:maintain-expanded="{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maintainExpanded
only pertains to the Group options, and should probably be combined with them.
groupOptions: {
enabled: true,
collapsable: true,
maintainExpanded: true,
rowKey: 'id'
}
@robgaston1 thank you for bringing this up. This should be the default option for collapsable rows. |
@xaksis I'm glad an internal id could be used. I couldn't figure out how to maintain that unique identifier inside the header row, so that's awesome. Thanks for releasing this so quickly! |
* add row style class to header row * add logic to maintain expanded rows * add documentation
* add row style class to header row * add logic to maintain expanded rows * add documentation
* Add feature to enable checking all checkboxes of a grouped table's children. The checkbox is available in span/non-span mode in the vgt-header-row. * Option to Keep Rows Expanded in Grouped Tables (#704) * add row style class to header row * add logic to maintain expanded rows * add documentation * Check for the selectAllByGoup using the same 'typeof' as the others * Move @click for vgtExpand to span's with the triangle and the header label. * This, because if it's on the TR, it will also expand when the checkbox is clicked. * Update docs * Remove groupOptions. Maybe used it at some point, But not anymore. * Remove doc (rebase thing?) * Newline Co-authored-by: Rob Gaston <[email protected]>
Description
We are attempting to implement a grouped table using the collapsable option. Our use case for the table is adding and removing things similar to a shopping cart. However, since the computed
originalRows
clones the rows anytime a change is made, thevgtIsExpanded
property on aheaderRow
gets lost anytime you alter the rows.Proposed Solution
This PR adds a new option as a prop,
maintainExpanded
. The prop allows you to enable this feature, as well as pass in arowKey
, so a value that is a unique identifier for your specific data. There is a data propertyexpandedRowKeys
that tracks all of the rows that are expanded, which is then checked when theoriginalRows
are recomputed to maintain the expanded value.One additional change made is that the
rowStyleClass
prop that we pass intovue-good-table
does not get applied to theheader-rows
. In our case we need to apply the same row styles to the header rows as the child rows.