3

I am working on jqxTreeGrid. I have a row with four fields. Name, Org, Phone and Select Preference (This is a dropdown). Now when ever i click on a particular row / cell, it selects that row and i save the row data to a local array.

My problem here is the 4th column. If i click on that column (dropdown) i don't want the rowSelect event to be fired because of the following reasons:

  1. It deselects a all previously selected rows which I ofcourse don't want to happen.
  2. It selects a row but my intention is to set the value of dropdown for that row.

I want nothing should happen as i am only selecting the value from preference dropdown.

I went though this post : JQGrid Not select row when clicking in a particular cell but it is not helping as jqxTreeGrid doesnot have this method.

I tried the following approach but its not working for me.

$('#ad_sendAlert_jqxGrid').on('rowClick',function(event){

                        // event args.
                        var args = event.args;
                        // row data.
                        var row = args.row;
                        // row key.
                        var key = args.key;
                        // data field
                        var dataField = args.dataField;

                        if(dataField === 'alertpreference'){
                            event.preventDefault();
                            //event.stopPropagation();
                            return false;
                        }
                });

And this is my rowSelect method:

$('#ad_sendAlert_jqxGrid').on('rowSelect',function(event){
       // event args.
        var args = event.args;
        // row data.
        var row = args.row;
        // row key.
        var key = args.key;

        if(row.level !== 0){                            
            var selectedUser = self.tempUserList[row.id];                            
            self.addUserToList(selectedUser);
        }                    
        self.renderUserCount();


});
Community
  • 1
  • 1
Yameen
  • 585
  • 1
  • 6
  • 17

1 Answers1

0

Looks like jqxTreeGrid has selectionMode option. Setting its value to "custom" will disable its default behavior of selecting row on click. Only API will then be able to select rows.

$('#treeGrid').jqxTreeGrid({selectionMode: "custom" }); 
Kiran Shakya
  • 2,521
  • 2
  • 24
  • 37