How to define "onClick" property of a datatable dynamically on a class

I tried to define “onClick” property of a datatable dynamically on a class “editLink” (first column having template : Smiley face) in the following way :

var editQuoteEvent = {
“editLink”:function(){
console.log(“coming under new event defined”);
}
};

root.$$(“quotationsRecordsDT”).define(“onClick”,editQuoteEvent);

But this didn’t workout for me.

Any help would be greatly appreciated.

template : …a href=‘javascript:void(0)’ class=‘editLink’… …img src=’…/…/common/images/editP.png’ alt=‘Smiley face’ height=‘20’ width=‘20’… …/a…

Please help …

Try to use the alternative syntax

root.$$("quotationsRecordsDT").on_click.editLink = editQuoteEvent;

Thanks you are a life saver…