grid onRowSelect doesn't fire

Hi,
When I click and select the grid row directly, it really fires onRowSelect event.
My situation is, there’re 2 grids, when I select the row in 1st grid, then its onRowSelect event fires, and do select the row in the 2nd grid with grid.selectRowById(rowId, true). However, there’s also an onRowSelect event for the 2nd grid row, and it doesn’t response. Is it a bug or my something wrong?
Thanks!

docs.dhtmlx.com/doku.php?id=dhtm … ectrowbyid has the solution:

selectRowById(row_id, preserve, show, call)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxgrid.js

selects row by ID

row_id - row id
preserve - {true|false} preserve previously selected (optional, false by default). Multi select mode should be enabled.
show - true/false - scroll row to view (optional, true by default)

call - true if to call onRowSelect function (optional, false by default)

Tofi, Now it works, and thank you very much.
But it seems unreasonable that selectRow doesn’t fire onRowSelect event.

hi jyginger ,

may be your calling the same event so, may be it conflicts…

i think

hi jyginger,

are you calling in the same function or else different individual functions…

hi, surya. my code looks like below:

var filegrid_event = function(){
  filegrid.attachEvent("onRowSelect", function(id,ind){
    dragged_all = grid_selectedRows(filegrid);
    var selectedImageIds = grid_selectedRows(imagegrid);
    if (selectedImageIds.length!=1 || selectedImageIds[0]!=id) {
      grid_selectRows(imagegrid,new Array(id));
      // this is added later, which I wish to execute when imagegrid fire onRowSelect event
      imageinfoForm_refresh(flayout.cells("c"),imageinfoForm,id);  
    }
  }); // end onRowSelect
}

var imagegrid_event = function(){
  imagegrid.attachEvent("onRowSelect", function(id,ind){
    var selectedFileIds = grid_selectedRows(filegrid);
    if (selectedFileIds.length!=1 || selectedFileIds[0]!=id) {
      grid_selectRows(filegrid,new Array(id));
    }
    imageinfoForm_refresh(flayout.cells("c"),imageinfoForm,id); 
  });
}