Hi everyone I have problem with firing jQuery event after ajax calls. I have method which calculates prices based on two inputs:
- quantity
- unit_price
amount_calculation_when_unit_price_change = (parent) -> $(".unit_price input").bind "keyup change paste", (e) -> unit_price = @value.replace(/\,/g,'.') quantity = $(this).closest(parent).find(".quantity input").val().replace(/\,/g,'.') value = ((parseFloat(unit_price) * parseFloat(quantity))) amount = $(this).closest(parent).find(".amount") if value.toString().match(pricePattern) amount.html('<br/>' + '$' + "#{(value.toFixed(2))}") else amount.html('<br/>' + '$' + "0.00") calculate_total()
It works ok. But I also have an autocompletion feature through ajax. And when I autocomplete this inputs through ajax this code is not fired. Is there any solution for this problem?