Abhinav Parashar
Abhinav Parashar

Reputation: 649

Prevent row click event in YUI Datatable

I have a YUI data table. When we click on any row of this data table, there is an alert box.

vtgtTbl.on('rowClickEvent',function(oArgs){    
alert("a");
}

I have a checkbox. what i want is that when that checkbox is true then row click will work, and not when it is false. so is there is any method in YUI to attach and detach these events

Upvotes: 0

Views: 153

Answers (1)

Diptendu
Diptendu

Reputation: 2158

Within the rowClick event handler callback you can add a check for the checkbox in the following way

vtgtTbl.on('rowClickEvent',function(oArgs){    
    var checkBoxNode = Y.one('#checkboxId');
    if (checkBoxNode.checked) {
        alert("a");
    }
}

Hope it solves the problem.

Upvotes: 1

Related Questions