2013-04-07 130 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