Sha256: 1b763fac4442be6d464fee89e94fd8c61c5a10d113a933f59ceea067bfe66760
Contents?: true
Size: 869 Bytes
Versions: 40
Compression:
Stored size: 869 Bytes
Contents
$(document).ready(function () { const jwt_token = $("#Config").data('jwt-token') // logg(jwt_token, 'jwt_token') if ($(".invoices-new").length) { $("select[name='invoice[items][][product_id]']").on('change', function(ev) { var productId = ev.target.value logg(productId, 'productId') $.get(`/api/products/${productId}.json?jwt_token=${jwt_token}`, function(_data) { logg(_data, '_data') $('select[name="invoice[items][][price_id]"]').empty(); // $('select[name="invoice[items][][price_id]"]').append($("<option disabled=true selected=true></option>").attr("value", '').text('Choose a price...') $.each(_data.prices, function(_, item) { $('select[name="invoice[items][][price_id]"]').append($("<option></option>").attr("value", item.id).text(item.name)); }) }) }) } })
Version data entries
40 entries across 40 versions & 1 rubygems