Turns out there IS a way after all. Had to add some functionality that I didn’t even know existed, and translate the JavaScript into jQuery, but it works!
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequest);
function EndRequest(sender, args) {
AttributeCustomizations();
}
$(document).ready(function () {
AttributeCustomizations();
});
function AttributeCustomizations() {
$('table[id*="dgRegistrationsList"]').children().not(':first').each(function () {
var dietPref = $("label:contains('Dietary Restrictions')", this).parent().parent();
// set a variable
var toptable = dietPref.parent().parent().parent().parent().parent().children();
// alert to see content for debugging
//alert(toptable.html());
// find dinner label
if (toptable.find('td[class="EventItemRegistrantsHeader"]:contains("Dinner")').length > 0) {
dietPref.show();
} else {
dietPref.hide();
}
});
}
See the Pen mFoly by Melanie Sumner (@melsumner) on CodePen.