button when a specific row is selected

The following code:

mygrid.attachEvent('onRowDblClicked',function(rowID, celInd) { var ContractID = mygrid.cells(rowID,6).getValue(); var ContractName = mygrid.cells(rowID,1).getValue(); add(-1,'Contract.php?ContractID='+ContractID,'Contract '+ContractName); });

allows me to click double on a row and open a php file related to a specific ContractID. How can I obtain the same result clicking on a button, located external from the datagrid?

You can get id of selected row with getSelectedRowId() method.
docs.dhtmlx.com/doku.php?id=dhtm … #selection