angular-data-table icon indicating copy to clipboard operation
angular-data-table copied to clipboard

selectable = true does not fire `onSelect` callback

Open brianfeister opened this issue 10 years ago • 3 comments

For some reason, when I set the options:

$scope.dtOptions = {
      selectable: true,
      multiSelect: true
}

the onSelect callback is fired, however if I disable multi-select and have just:

$scope.dtOptions = {
      selectable: true
}

the `onSelect callback never fires. Is this by design or a bug? To me, it seems like very odd interface.

brianfeister avatar Aug 08 '15 19:08 brianfeister

The callback fires for me but the selected object is not getting referenced correctly in the page controller. I create a single select demo that demonstrates this but don't have to address right now.

amcdnl avatar Aug 13 '15 19:08 amcdnl

Is this still an issue?

amcdnl avatar Sep 15 '15 16:09 amcdnl

I am seeing the onSelect fire, however the selected row is null. This was just because the demo shows on-select="onSelect(row)", when it should be (based on the code) on-select="onSelect(rows)".

This is in SelectionController.js:90.

Also, when in single selection mode, the binding of selected="selected" will not work since it replaces the object. Seems like it would be easiest to just splice this.selected for single select. That is, having the two modes work the same seems like a good idea.

mpholcomb avatar Jan 08 '16 22:01 mpholcomb