josebalius / ngReactGrid

A really fast Angular grid using the power of React to render. Based on ng-grid and jQuery DataTables.
http://josebalius.github.io/ngReactGrid/
MIT License
328 stars 47 forks source link

Using both checkbox selection and rowClick #37

Closed pmq closed 9 years ago

pmq commented 9 years ago

Hi there!

When using both checkbox selection (ngReactGridCheckbox) and rowClick, there is an obvious problem; the rowClick does fire when clicking on the checkbox.

In our case, we use the rowClick to open a detail view (using a $location.path, etc), so the checkbox gets selected for a few milliseconds then the new controller shows up. Obviously this kills most of the fun of having row selection :)

So we would probably need to override the rowClick listener on the checkbox cells. I've tried to patch it by stopping the event propagation, but didn't have time to finish. I'm opening this issue for discussion. In any case as I need this, I'll be spending some time in the coming days proposing a fix. Copying @ewu02 as I've read most of your commits on checkbox selection, and maybe you have an idea on how to fix this elegantly.

ewu02 commented 9 years ago

Hope this helps https://github.com/josebalius/ngReactGrid/pull/39

pmq commented 9 years ago

Wow, you're quick! Thanks a lot for the patch. Tried it on our case, but it still executes the rowClick handler on Chrome 38 / Mac. Hmmm, I'll investigate more.

ewu02 commented 9 years ago

Ah I see, missed out on rowClick being a custom event earlier. This should resolve it: https://github.com/josebalius/ngReactGrid/pull/40

pmq commented 9 years ago

40 solves it. You rock, thanks!

josebalius commented 9 years ago

Merged, thanks guys!