2013-04-07 132 views
0

删除/取消收听我没如下订阅数据表的事件(YUI data table):如何从数据表中使用YUI

myDataTable.subscribe("cellClickEvent", this.myDataTable.onEventShowCellEditor);

我如何能实现如下?

If (condition) 
    show cell editor 
else 
    remove or hide cell editor 

Thanks in Adv。

+0

你应该给你的例子添加更多的代码。 – 2013-04-07 09:17:53

回答

0

onEventShowCellEditor没什么特别的,它只是调用方法showCellEditor。你也可以。而不是设定一个监听事件,然后将其直经为onEventShowCellEditor把自己的听众,而不是有和之前调用showCellEditor决定:

myDataTable.subscribe('cellClickEvent', function (oArgs) { 
    if (condition) { 
     myDataTable.showCellEditor(oArgs.target); 
    } else { 
...whatever 
    } 
}); 
+0

谢谢,它适合我。 – 2013-04-09 06:36:58