开发者

jQuery Filtering Gridview Columns

开发者 https://www.devze.com 2023-01-04 11:14 出处:网络
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 righ

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').ht开发者_高级运维ml();
      __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
})


//Selects all but last column

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

//Selects last column

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消