Open pws2016 opened 3 years ago
Using setTimeout would resolve your issue I believe. i.e.
hide: function (deleteElement) { if(confirm('Are you sure you want to delete this element?')) { $(this).slideUp(deleteElement); setTimeout(function(){ return calculContoEco(); }, 500); } },
I hope that helps.
In my case adding my function inside the slideUp call worked. Something like this: $(this).slideUp(function(){ deleteElement(); calculContoEco(); );
I hope that this will help anyone that doesn't want to alter the library or doesn't trust the timeout solution, which despite working raises some concerns. ✌🏻
Thanks for sharing your solution @mbofos01 , it worked fine
Hello, I have custom JS function which do cacul of value in repeater item but when delete item the function not return right value because i use node items to do the calcul but after click node remain exist in DOM html!! i try also to use repeaterVal() but not get all inputs for each row!! How i can fix this? my custom function code is: ` $(document).ready(function () { 'use strict';
function calculContoEco(){ var inv_immo_immateriali_total_year_1=0; $(".inv_immo_immateriali_amount_year_1").each(function( index ) { var v=parseFloat($(this).val()); if(isNaN(v)) v=0; inv_immo_immateriali_total_year_1=inv_immo_immateriali_total_year_1+v; }); $("#inv_immo_immateriali_total_year_1").text(inv_immo_immateriali_total_year_1); } `