Hi,
I want to hide/show Delete button based on condition in subgrid(SharePoint Document Location).

I have tried the below JS code to hide button, but it won't work.
var entityGridDocument = $(".subgrid.sharepoint-grid").eq(0);
//var entityGridDocument = $(".entity-grid.subgrid").eq(0); Tried this as well
entityGridDocument.on("loaded", function () {
entityGridDocument.find("table tbody > tr").each(function(index, tr) {
if(myStatus == "1")
{
$(tr).find('.btn.btn-default.btn-xs').hide();
}
});
});
I have also tried to add Basic Form Metadata as Subgrid and add Filter Criteria for Delete Button. But it didn't work.