views:

72

answers:

2

I'm looking to have a click event for all columns but the last column of a GridView and then have a separate click event for the last column of the gridview (a DropDownList). I have the following right now but just can't seem to get it to exclude the last column:

var _activeRow;
$('.gridview-jquerify tr').filter(function() {
     return $('td', this).length && !$('table', this).length
})
.bind('click', function(e) {
     if (_activeRow) _activeRow.removeClass('gridviewrow-highlighted');
     _activeRow = $(this).addClass('gridviewrow-highlighted');
     $(this).each(function() {
          var myID = $(this).find('.gridview-cell-hide').html();
      __doPostBack('MyUpdatePanel', myID);
     });
});

Then I can't seem to get a variation of the above to work for the last column by doing a filter using :last in the selector such as:

$('.gridview-jquerify tr >td:last').filter(function() {
     return $('td)', this).length && !$('table', this).length
})
+1  A: 
//Selects all but last column

$(".gridview-jqueryify tr td:not(:last-child)")

//Selects last column

$(".gridview-jqueryify tr td:last-child")
wowo_999
thanks this will do the trick!
RSchmitt
A: 

Perfect extension to embed jQuery into Chrome Console as simple as you can imagine. This extension also indocates if jQuery has been already embeded into page.

This extension used to embed jQuery into any page you want. It allows to use jQuery in the console shell (You can invoke Chrome console by "Ctrl+Shift+j").

To embed jQuery into selected tab click on extention button.

LINK to extension: https://chrome.google.com/extensions/detail/gbmifchmngifmadobkcpijhhldeeelkc

Andrey