문제

I did subscribe an event on data table as follows (YUI data table):

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

how can I achieve as follows?

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

Thanks in Adv.

도움이 되었습니까?

해결책

onEventShowCellEditor is nothing really special, it simply calls method showCellEditor. So can you. Instead of setting a listener for the event and pass it straight through to onEventShowCellEditor put your own listener there instead and decide prior to calling showCellEditor:

myDataTable.subscribe('cellClickEvent', function (oArgs) {
   if (condition) {
        myDataTable.showCellEditor(oArgs.target);
   } else {
...whatever
   }
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top