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

Grid "active" state, separate from "selected" #9969

Closed
baleeds opened this issue Aug 4, 2021 · 9 comments · Fixed by #10022
Closed

Grid "active" state, separate from "selected" #9969

baleeds opened this issue Aug 4, 2021 · 9 comments · Fixed by #10022
Assignees
Labels
🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@baleeds
Copy link

baleeds commented Aug 4, 2021

Is your feature request related to a problem? Please describe.

Our UX requires checkbox multi-select for performing bulk actions but also has the ability to click a single row and open a details panel. The row that is being viewed in the details panel is then "active" and should have a blue background. The selection state is decoupled from the active state.

Describe the solution you'd like

I would like the ability to specify whether a row is "active" or the ability to specify custom classes based on the data in a row. Another option would be to have the row ID as a data attribute on the row DOM element.

I'm sure your team has seen ag-grid. Not saying you should be more like ag-grid, but they do have a feature where the grid options can specify a "getRowClass" callback which provides the row data and returns class names for a row. This feature would work to solve our problem, since we track the "active" state independently from the grid. One common way to track the active state would be the ID of an item in the current route.
https://www.ag-grid.com/javascript-grid/grid-callbacks/#reference-callbacks

Describe alternatives you've considered

The only way I can think to do this with my current understanding is to keep track of the active row primary key, and use the template context on each column template to determine if this column's row's data is active.

@ddincheva
Copy link
Contributor

ddincheva commented Aug 9, 2021

Hello @baleeds,
We take a look at your request and currently we have two grid input properties evenRowCSS and oddRowCSS, which allow you to set custom classes on rows but we can see why this is not enough to address your request.
So about your suggestion, we have already implemented such behavior but it is only available on grid's cell:
we have introduced cellClasses and cellStyles input properties which can be set on column level. Here you can see more detailed description.
So currently we are planning to introduce similar properties on grid level - probably rowClasses and rowStyles which will accept an object containing key-value pairs. /key is the name of the CSS class/property, the value is either a callback function that returns a boolean or boolean value/. The callback signature for both rowClasses and rowStyles will be:
(row: RowType) => boolean
Please let us if this going to fulfill your us case.

@baleeds
Copy link
Author

baleeds commented Aug 9, 2021

@ddincheva Yes, the rowClasses and rowStyles callbacks would be immensely helpful! Is there a timeline on when we might see that feature?

@radomirchev
Copy link
Contributor

Hi @baleeds , I am the Product Owner of Ignite UI for Angular. I would like to inform you that the feature has been included in milestone 18 in our roadmap. When we have draft specification for the feature, you would be updated and you can provide feedback on it. The feature would be released with our next major release. P.S> The ROADMAP is to be updated till end of the week

@baleeds
Copy link
Author

baleeds commented Aug 10, 2021

Thanks @radomirchev! I greatly appreciate the details 👏

Is there a projected timeframe for when the major release might occur? We are deciding how to proceed in the meantime.

@radomirchev
Copy link
Contributor

@baleeds we are targeting end of Sept for the feature release. Which version of Ignite UI you're using?

@baleeds
Copy link
Author

baleeds commented Aug 30, 2021

We are currently on 11.1.2, but we will do major updates for this feature.

@ddincheva ddincheva added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Sep 13, 2021
@hanastasov
Copy link
Contributor

hanastasov commented Sep 14, 2021

@baleeds, we exposed this feature in an alpha version if you want to test it in advance. The version is 12.2.0-alpha.2 available on npm already.

@baleeds
Copy link
Author

baleeds commented Jan 10, 2022

Just wanted to thank you all for your attention to this. The row classes (and styles) feature is working great for our use cases. 🎉

@zdrawku
Copy link
Contributor

zdrawku commented Jan 11, 2022

Thank you, @baleeds! We strive to listen whenever our customers have anything to share. Any type of feedback is highly appreciated as it validates our product direction, with that said, please feel free to share your feedback/review here.

Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants