Home > front end > Asynchronous add elements don't show, into a synchronous display. Why?
Asynchronous add elements don't show, into a synchronous display. Why?
Time:09-27
As shown in figure, this want to after the success of the asynchronous loading data, according to data obtained from the dynamic adding datagrid, asynchronous loading test data is successful, but add a form does not display, to synchronize loading shows, best may not be the solution, consult the greatly?
CodePudding user response:
At first to write a page table set id, API response to initialize the form again after not? $(id). The datagrid (options)
CodePudding user response:
Several forms, format is the same, I want to write an API response data for several tables, so want to dynamically add elements on the page
CodePudding user response:
Multiple tables dynamically generated should be no problem, each written inside a function call try parameter val initDataGrid (val)
CodePudding user response:
Thank you very much! Can speak more in detail? Async is true to add form does not display, there is no error in the page, instead of false shows, is page rendering on what to do?
CodePudding user response:
The $. Each content written inside a initDataGrid (val) method, in $. Each loop inside calls. Estimates is rendering problem, if it doesn't do delay under 50-100 ms
CodePudding user response:
When the async attributes value to false are synchronous, Ajax requests the entire browser locked, only the Ajax request returns the results, to perform Ajax behind alert statement,
When async attribute evaluates to true is asynchronous, which will not wait for ajax request returns as a result, will be executed directly behind the ajax alert statement,