I am trying to enable and disable the custom Ribbon button based on the form's subgrid values.I created a simple Java script method as a web resource and call it in Enable rule using workbench. below is my code:
function DisableSendInvitationRibbonButton()
{
alert('test');
var gridControl = document.getElementById("Attendees").control;
if (gridControl.readyState != "complete")
{ alert('readyState not Complete');
// delay one second and try again.
setTimeout(DisableSendInvitationRibbonButton, 100);
return;
}
else
{ alert('readyState Complete');
var ids = gridControl.get_allRecordIds();
alert(ids.length);
}
}
The code is only hitting alert"Test", It looks like subgrid is not loading. Any help would be appreciated.
Thanks !