I am adding a custom button to an Entity List
I want to hide/show the button depending on a specific column value of each row.
The red below code works on the ID of the row = ????, but I need to replace the data-id with a whole number column called [Count] so that if this [Count] column is 0 it wont display the button, anything above it will
$(document).ready(function () {
$(".entitylist.entity-grid").on("loaded", function () {
$(this).children(".view-grid").find("tr[data-id]").each(function (i, e){
var id = $(this).attr("data-id");
if ($(this).attr("data-id") == "996b793b-f675-ec11-8943-00224807089a"){
$(this).append("<td><input type='button' style='background-color:lightgreen' onclick='callPowerAutomateInPerson(\"" + id + "\");' value='Attend The Gym' /></td>");
}
});
});
});