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

Datatable rowClickEvent: Howto get content of selected row?

Expand Messages
  • berli.michael
    Hi ! I need help. I want to alert a string when a row of my YUI-Datatable is clicked. I have this code: myDataTable.subscribe( rowClickEvent , dosomething); My
    Message 1 of 2 , Sep 1 7:45 AM
    • 0 Attachment
      Hi !
      I need help. I want to alert a string when a row of my YUI-Datatable
      is clicked. I have this code:

      myDataTable.subscribe("rowClickEvent", dosomething);

      My problem is the function dosomething():

      function dosomething(){
      var elRow = myDataTable.???;
      elRow = myDataTable.getTrEl(elRow);
      var oRecord = myDataTable.getRecord(elRow);
      alert("id is:" + oRecord.getData("ID"));
      }

      Which method must be called on the first line (???) ? The data "ID" is
      available.

      Thanks for the help :)

      Best regards,
      Mike
    • Satyam
      myDataTable.subscribe( rowClickEvent , function (oArgs) { var elTarget = oArgs.target; var oRecord = this.getRecord(elTarget); alert( id is: +
      Message 2 of 2 , Sep 1 9:12 AM
      • 0 Attachment
        myDataTable.subscribe("rowClickEvent", function (oArgs) {
        var elTarget = oArgs.target;
        var oRecord = this.getRecord(elTarget);
        alert("id is:" + oRecord.getData("ID"));
        });



        berli.michael wrote:
        > Hi !
        > I need help. I want to alert a string when a row of my YUI-Datatable
        > is clicked. I have this code:
        >
        > myDataTable.subscribe("rowClickEvent", dosomething);
        >
        > My problem is the function dosomething():
        >
        > function dosomething(){
        > var elRow = myDataTable.???;
        > elRow = myDataTable.getTrEl(elRow);
        > var oRecord = myDataTable.getRecord(elRow);
        > alert("id is:" + oRecord.getData("ID"));
        > }
        >
        > Which method must be called on the first line (???) ? The data "ID" is
        > available.
        >
        > Thanks for the help :)
        >
        > Best regards,
        > Mike
        >
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - http://www.avg.com
        > Version: 8.0.169 / Virus Database: 270.6.13/1642 - Release Date: 29/08/2008 18:12
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.