Loading ...
Sorry, an error occurred while loading the content.

21710overriding functions in DataTable not working

Expand Messages
  • Ryan V. Bayona
    Dec 2, 2007
      i have this snippet and its not working for me
      var myDataTable = new
      YAHOO.widget.DataTable("myContainer",myColumnDefs,myDataSource,{scrollable:
      true}) ;
      myDataTable.subscribe("rowMouseoverEvent",
      myDataTable.onEventHighlightRow);
      myDataTable.subscribe("rowMouseoutEvent",
      myDataTable.onEventUnhighlightRow);
      myDataTable.subscribe("rowClickEvent", myDataTable.onEventSelectRow);

      //override

      YAHOO.widget.DataTable.onEventSelectRow = function(ev)
      {
      target = YAHOO.util.Event.getTarget(ev);
      alert(target)
      dataIndex = myDataTable.getRecordIndex(target);
      alert(dataIndex)
      alert(myDataSource.liveData[parseInt(dataIndex)].information)
      }

      its not even doing the alert thing.. am i doing this properly?
    • Show all 3 messages in this topic