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

Is it possible to expend a row on double click? #102

Closed
hanogin opened this issue Sep 12, 2022 Discussed in #101 · 2 comments
Closed

Is it possible to expend a row on double click? #102

hanogin opened this issue Sep 12, 2022 Discussed in #101 · 2 comments
Labels
question A request for information, clarification, or support

Comments

@hanogin
Copy link

hanogin commented Sep 12, 2022

Discussed in #101

Originally posted by tim6400 September 10, 2022
The button in the action column works grate.
But what if i want to expend a row from double click on row or from other action buton?
Lets say i whant to do an expend button on column other then "action", is it possible?

@uap-universe uap-universe added the question A request for information, clarification, or support label Sep 12, 2022
@uap-universe
Copy link
Collaborator

This is currently not directly supported.

But the API is so open that you could achieve that by just invoking the right public methods.

In your renderComponent you register some sort of event handler for your double-click event - ideally with the Row object as parameter (if you have access to that), or with the row index s.t. you can look up the row by yourself.

Then in your handler you access the smart table directly (via @ViewChild for example) and either invoke this.mytable.onExpandRow(row) or - maybe a bit more cleaner - this.mytable.grid.expandRow(row).

However, these methods are not documented as they are - imho - just accidentally part of the public API. So please use at your own risk.

Alternatively we could add some "official" API that works somehow similar to programmatic row selection (the selectRow() method).

But to be honest, I am not really sure about that one either... I think there is a lot of confusion when to use row and when to use index and what index actually means (the index in the data array vs. the index in the visually presented table including filter and sorting, etc.).

So as a short term feature (or let's call it a version 2.x feature), we could add that, but maybe things will get refactored eventually for a 3.0 version. But before that, I am interested in how easy it actually is to propagate the double click event from the render component to wherever it has access to the smart table. The solution I could come up with is an event emitter in the custom renderer that can be subscribed to in the onComponentInit() method.

@hanogin
Copy link
Author

hanogin commented Sep 13, 2022

Thanks for your detailed response.

@uap-universe uap-universe closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A request for information, clarification, or support
Projects
None yet
Development

No branches or pull requests

2 participants