obj.rowSelect = function (evt, ui) { console.log(evt); if(evt is from mouse click) do work1; else do work 2; };