2
Here I call the mask wearing class
$(function($){
$(".dinheiro").maskMoney();
});
in form inputs works normal, but in table does not work.
function addProd(obj) {
$('#add_prod').val('');
var id = $(obj).attr('data-id');
var name = $(obj).attr('data-name');
var price = $(obj).attr('data-price');
$('.searchresults').hide();
if ($('input[name="quant[' + id + ']"]').length == 0) {
var tr =
'<tr>' +
'<td>' + id + ' - ' + name + '</td>' +
'<td>' +
'<input type="number" name="quant" class="p_quant" value="1" onchange="updateSubtotal(this)" data-price="' + price + '" />' +
'</td>' +
'<td>' + price + '</td>' +
'<td>' +
'<input type="text" name="servico[' + id.trim() + ']" class="servico" onkeyup="carregaServico(this)" id="servico[' + id.trim() + ']" data-type="search_servico" />' +
'</td>' +
'<td width="10%" class="dinheiro">' +
'<input type="text" name="vlr_servico[' + id.trim() + ']" data-id="' + id + '" onblur="formataDinheiro(this)" id="vlr_servico[' + id.trim() + ']" class="dinheiro" />' +
'</td>' +
'<td class="subtotal">' + price + '</td>' +
'<td><a href="javascript:;" onclick="excluirProd(this)">Excluir</a></td>' +
'</tr>';
$('#products_table').append(tr);
}
updateTotal();
}
already arranged, was in home template was calling jquery 3.1 in view copied datatables link with jquery 1.12, ai gave error
– Junior Ramoty
@Juniorramoty Oh, that’s good. Then post an answer explaining how you arranged or schedule an answer so as not to leave the question pending. Good night!
– Sam