I am trying to disable the button present in the last column of Data table. Using the code below works only for the products displayed in the first pagination. If we alter the table length then for the rest of the products, button is enabled.
$.ajax({
url: custom.ajaxurl,
type: "GET",
data: { action: 'checkStoreStatus', store_id: store_id },
success: function(returned)
{
var object = JSON.parse(returned);
if(object['status'] == 'close'){
$('.single_add_to_cart_button').prop('disabled', true);
} else {
$('.single_add_to_cart_button').prop('disabled', false);
}
},
error: function(exception) {
console.log("ex:"+exception);
}
});
If table length is set to 10 by default then this CSS is applied to only the 10 rows
When table length is adjusted to the 25 then the button isn't disabled

