tochoromero / aurelia-table

Simple functional data table for Aurelia
https://tochoromero.github.com/aurelia-table
MIT License
67 stars 25 forks source link

Event for Button in a row #19

Closed joshua1 closed 7 years ago

joshua1 commented 7 years ago

Hi @tochoromero , This Plugin is a life and time saver, thanks for this. The API has provision for row selection, what if i want to triiger an event by clicking a button on a column, how do i go about that, i would like a situation where the click event of the button can harness the select.delegate event and have access to the row data

tochoromero commented 7 years ago

I'm glad you find the plugin useful. As it is right now, the only way to trigger the select event in the row is using the aut-select custom attribute, and unfortunately, it will only get triggered when the user clicks the row itself.

I can add a feature to aut-select where it doesn't listen for clicks in the row element, instead, it will the user responsibility to set and remove the $isSelected property on the selected rows.

This way you can have a button (or whatever you want) that toggles this property. The aut-select will still trigger the event, set the row class and respect the selection mode (single, multiple).

I think I can implement the new feature in the next couple of days.

Regards.

joshua1 commented 7 years ago

Thanks @tochoromero. It would be nice for users to have both options

tochoromero commented 7 years ago

I have added the feature. Please check the documentation under the Selection section. There is now a Custom Selection section.

joshua1 commented 7 years ago

Ok @tochoromero i will do that now. Thanks for your effort. much appreciated