troubleshooting Question

Could you point how to disable buttons by using jQuery depending on a bale column value?

Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil asked on
PHPjQuery
4 Comments1 Solution118 ViewsLast Modified:
Hi Experts

Could you point how to disable buttons by using jQuery depending on a bale column value?

Accordingly to

img003
When the column value of the Staus column is "Concluido" the buttons must to be disabled.

PHP
<td>
	<a href="http://<?php echo APP_HOST; ?>/produto/edicao/<?php echo $produto->getId(); ?>" class="btn btn-info btn-sm">Editar</a>
	<a href="http://<?php echo APP_HOST; ?>/produto/exclusao/<?php echo $produto->getId(); ?>" class="btn btn-danger btn-sm">Excluir</a>
</td>

jQuery (using previous reply)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(function() {
	$('.table tr').each(function(i,e) {
		if ($('td:eq(4)', this).text() == 'Concluido') {
			$(this).css({backgroundColor: 'green'});

                         // It doesn't works
                         $('.btn btn-info btn-sm').prop('disabled', false);
                         $('.btn btn-danger btn-sm').prop('disabled', false);

		}
	});
});
</script>

Thanks in advance!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros