Skip to content

Instantly share code, notes, and snippets.

@ChrisMoney
Last active August 29, 2015 14:27
Show Gist options
  • Save ChrisMoney/fb959c14f4d0b4246929 to your computer and use it in GitHub Desktop.
Save ChrisMoney/fb959c14f4d0b4246929 to your computer and use it in GitHub Desktop.
JQuery - Get table row and cell without ID. For table use table ID, for grid use grid ID
<script type="text/javascript">
$(document).ready(function () {
// uwg is a grid ID.
// always use closest when selecting a specific row
$('[id$=uwgAssignedQualifyingEvents]').delegate("tr", "click", function(e) {
var lostEligibility = $(this).closest('tr').find('td:eq(6)').text();
if (lostEligibility.length > 1) {
//alert(lostEligibility);
$('[id$=btnAddToTournament]').prop("disabled", true);
$('[id$=btnReQualifyToTournament]').prop("disabled", true);
$('[id$=btnRemoveFromTournament]').prop('disabled', true);
}
else {
$('[id$=btnAddToTournament]').removeAttr('disabled');
$('[id$=btnReQualifyToTournament]').removeAttr('disabled');
$('[id$=btnRemoveFromTournament]').removeAttr('disabled');
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment