Created
March 24, 2013 21:33
-
-
Save Oblongmana/5233633 to your computer and use it in GitHub Desktop.
Short #jQuery chunk which assigns an #onClick #function to each #pageBlockTable #row which finds the #checkbox in the row and simulates the onClick event on the checkbox. Ignores clicks on the checkbox itself, and ignores clicks on links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dataRow is the class that Salesforce applies to all data rows, but you could equally use this in a non Salesforce context | |
$(".dataRow").click(function(event) | |
{ | |
//Ignore link and checkbox clicks, otherwise find the row's checkbox and click it | |
if(event.target.type!=="checkbox" && !$(event.target).is('a')) { | |
$(this).find($("input:checkbox")).click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment