Skip to content

Instantly share code, notes, and snippets.

@Oblongmana
Created March 24, 2013 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oblongmana/5233633 to your computer and use it in GitHub Desktop.
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
//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