cagatay.civici wrote:
Yes, this.onEventSelectRow(args) selects the row for you meaning changes style class to selected and adds the row to selected rows.
Well. What I meant - you have an own handleRowClickEvent (PrimeFaces extends YUI DataTable)
handleRowClickEvent : function(args) {
this.onEventSelectRow(args);
if(this.isDynamic()) {
document.getElementById(this.rowSelectParam).value = this.selectedRowsState.join(',');
} else {
var selectedRows = this.getSelectedRows(),
selectedRowIndexes = [];
for(var i=0; i < selectedRows.length; i++) {
selectedRowIndexes[i] = this.getRecord(selectedRows[i]).getData('rowIndex');
}
document.getElementById(this.rowSelectParam).value = selectedRowIndexes.join(',');
}
if(this.configs.update) {
this.doInstantRowSelectionRequest();
}
}
Therefore, in my opinion, the right code would be
dt.subscribe("rowClickEvent", handleCustomRowSelect);
handleCustomRowSelect = function(args) {
this.handleRowClickEvent(args);
var selectedRows = this.getSelectedRows();
//custom code with selectedRows
}
I have to call handleRowClickEvent and not onEventSelectRow in my custom function. Right?