Dom element not update in loop

i create progress bar but my progress bar not update in loop…it works after process will complete…

here is my code 

$.each(data.message, function(i, rowt) {
						
						setTimeout(function() {
						 var iteration = Math.trunc(data.message.length/10);
											
											
											if(i+1==count){
												count=count+iteration;
												console.log("hii"+count)
												process=process+10;
											}
											var element = document.getElementById("myprogressBar");    
											 
												  element.style.width = process + '%';
						}, 1000)
						
						
						d = cur_frm.add_child("plot_number_mapping");
						d.plot_number = rowt.final_serial_number;
						d.house_number = rowt.house_number;
						d.house_address=rowt.house_address ? rowt.house_address : "";
						
						
						
					});
					cur_frm.refresh_field("plot_number_mapping");

I feel you should look at the implementation of standard progress indicators in Data Import, Work Order etc.

Hey @pratikcws,

  • Use frm.dashboard() to show progress rather than hack.
  • You can refer this for an example.

Regards
@hrwx