开发者

How to subscribe to an event in Yahoo YUI 2.0?

开发者 https://www.devze.com 2023-04-11 08:13 出处:网络
So I have a datatable and that shows a whole bunch of data, one column of which I want to be editable inline through the use of a set of radio Buttons. The relevant code is here:

So I have a datatable and that shows a whole bunch of data, one column of which I want to be editable inline through the use of a set of radio Buttons. The relevant code is here:

{key: "SessionOccurred", label: "Did Session Occur?", editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Yes","No","N/A"], disableBtns:false })},

Now below this code, I want to subscribe to the event where a cell i clicked on and this set of radiobuttons with the options "yes", "no" and "n/a" appears. To do that, i use the following code:

    Ex.myDataTable.subscribe("cellClickEvent", Ex.myDataTable.onEventShowCellEditor);         
    Ex.myDataTable.subscribe("cellClickEvent", function(oArgs){
        alert('success');})

I just cannot get this radioClickEvent subscription to trigger though. The "cellClickEvent" subscription definitely does开发者_如何学编程 trigger, because when I click on a cell, the radiobutton options appear. But I just can't get the function to trigger with the radioClickEvent.

If anyone could share any ideas on what I may be doing wrong, that would be greatly appreciated. Thanks a lot ahead of time.


You can try to combine it to one subscribe call:

Ex.myDataTable.subscribe("cellClickEvent", function (oArgs) {
    Ex.myDataTable.onEventShowCellEditor(oArgs);
    alert('success');
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号