It has been a while since I have posted a new jQuery snippet, mostly because I only get to play with jQuery once in a while (though I wish I could use it more). Recently I had to create an administration page for deleting multiple rows of data. I presented the data in a gridview using checkboxes as the control for selecting which items will be deleted. I wanted to make it clear which items were going to be deleted so, using jQuery, I wrote the following snippet to accomplish what I wanted.
Obviously you will need to define a CSS class called “highlight”. I think the best thing about this snippet of code is that it will work if you are using a standard HTML table to organize your data or you are using a GridView object in ASP .NET. This snippet will also ignore the row that contains the “Select All” checkbox; for my purposes the select all checkbox was in the header of the table/grid.
$('#SurveyGrid input:not(#selectAll)').click(function () {
if ($(this).attr("checked") == true) {
$(this).parent().parent().addClass('highlight');
} else {
$(this).parent().parent().removeClass('highlight');
}
});
I have posted this code on snipplr.com (as usual).
Despite the fact that I make my living providing Microsoft solutions using .NET, many know that I have never been a big fan of Microsoft. I stated that because I want to be upfront about my past feelings and that I am going to try not to let those feelings influence this topic. I am going to discuss this based on my interpretation of the evidence I see in the industry today. I think that Microsoft is no longer a leader but frantically playing catch-up instead.
A couple weeks ago
After eight seasons, Hugh Laurie is hanging up the cane. While I know that all the characters are fictional and that Princeton Plainsboro doesn’t exist, House was still a pretty big part of my reality. The cast and crew of House have made amazing television over the past eight years and I wish all of them luck in their new projects. I intend to keep close tabs on a few of them to see where they go to next. I was very upset when I heard that FOX was not going to renew House for another season and I’m still pretty upset with FOX because I feel like they forced Hugh Laurie to end the series so FOX could free up the time slot. Why do that to such a successful series, especially when we barely got to know Park and Masters.