0

I implemented dxData grid with the following option. selection: { mode: 'multiple' } And also have a different functionality for onRowClick & onSelectionChanged.

While the onRowClick event is getting fired , It fires the onSelectionChanged event also.

Can anyone suggest how to differntiate these two event? I mean when the row click event is getting fired, it should not file the onSelectionChanged event. The onSelectionChanged event should fire while selecting the check boxes.

Thank you

Anuradha
  • 169
  • 1
  • 10

1 Answers1

2

This is expected behavior for the dxDataGrid widget.

To implement your scenario you can add a column with checkboxes manually:

{ 
     name: 'Selected',
     cellTemplate: function($cell, cellInfo) {
         var $checkBox = $("<div>").dxCheckBox({
             onValueChanged: function(args) {
                 // put selection changed handler here....
             }
            }).appendTo($cell);
        }
}

I've created a small sample here - http://jsfiddle.net/v2fswrvr/

Sergey
  • 5,396
  • 3
  • 26
  • 38
  • In that example also it is not working because when we checking an checkbox row click event is getting fired. – Anuradha Sep 22 '15 at 09:19
  • 1
    Use [stopPropagation](https://api.jquery.com/event.stoppropagation/) to fix it. http://jsfiddle.net/v2fswrvr/2/ – Sergey Sep 22 '15 at 11:22