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

Highlight multiple rows.

Expand Messages
  • Corey Kaye
    Hi !! I have a checkbox in a datatable that calls a custom function. I want to highligh the row which works, but when i check another row it un-highlights the
    Message 1 of 2 , Dec 22 12:05 PM
      Hi !!

      I have a checkbox in a datatable that calls a custom function. I want
      to highligh the row which works, but when i check another row it
      un-highlights the first row and highlights the second. Why is it
      un-highlighting? Should i use a custom function to add my own class to
      highlight the row instead and if so, can you give a quick example of how
      i'd do this?

      // Custom event for checkbox selection
      DNS.myDataTable.onEventSelectCheckbox = function(oArgs){
      var elCheckbox = oArgs.target;
      var elRecord = this.getRecord(elCheckbox);
      var isSet = elCheckbox.checked ? 1 : 0;
      DNS.myDataTable.getRecordSet().updateKey(elRecord,
      "VisualCheckbox", isSet);
      DNS.myDataTable.highlightRow(elRecord);
      DNS.campaignAtAGlance.updatePanelMath();
      }


      Thanks for all your help!
      CK
    • Satyam
      Method highlightRow allows for only one row highlighted at a time. Method selectRow, though, does allow multiple row selection, which will also highlight the
      Message 2 of 2 , Dec 22 1:25 PM
        Method highlightRow allows for only one row highlighted at a time. Method
        selectRow, though, does allow multiple row selection, which will also
        highlight the rows selected. Otherwise you will be stuck with looking for
        the row (getTrEl()) and use addClass to add your own 'highlighted' style.

        Notice that just as getRecord works using 'this', the rest of the functions
        do as well, no need to make the interpreter resolve DNS.myDataTable
        everytime when 'this' is readily available.

        Satyam



        ----- Original Message -----
        From: "Corey Kaye" <kayec@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Saturday, December 22, 2007 9:05 PM
        Subject: [ydn-javascript] Highlight multiple rows.


        > Hi !!
        >
        > I have a checkbox in a datatable that calls a custom function. I want
        > to highligh the row which works, but when i check another row it
        > un-highlights the first row and highlights the second. Why is it
        > un-highlighting? Should i use a custom function to add my own class to
        > highlight the row instead and if so, can you give a quick example of how
        > i'd do this?
        >
        > // Custom event for checkbox selection
        > DNS.myDataTable.onEventSelectCheckbox = function(oArgs){
        > var elCheckbox = oArgs.target;
        > var elRecord = this.getRecord(elCheckbox);
        > var isSet = elCheckbox.checked ? 1 : 0;
        > DNS.myDataTable.getRecordSet().updateKey(elRecord,
        > "VisualCheckbox", isSet);
        > DNS.myDataTable.highlightRow(elRecord);
        > DNS.campaignAtAGlance.updatePanelMath();
        > }
        >
        >
        > Thanks for all your help!
        > CK
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG Free Edition.
        > Version: 7.5.516 / Virus Database: 269.17.6/1192 - Release Date:
        > 21/12/2007 13:17
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.