Tuesday, September 18, 2012


Highlighting a row in JQuery:




  • Highlighting the row that contains the word site with the css class row_total.

             $("#tableID").find("tr:gt(0):contains('site')").attr("class", "row_total");



  • Highlighting the row that contains the css class named subtotal-header with the css class row_total, useful in case of display tag.

                $('# tableID .subtotal-header').closest('tr').attr("class", "row_total");



  • // on select function for selection and deselection of row.


                  function highlightRow(obj)
                   {
                 /* Add/remove class to a row when clicked on */
                $(obj).closest("tr").toggleClass('row_selected'); 
                   }

No comments:

Post a Comment