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,

CodePudding user response:

refer to 6th floor qq_19601709 response:
when the async attributes value to false are synchronous, Ajax requests the entire browser locked, only an Ajax request to return to the results, to perform Ajax alert behind the 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,


How will return results after adding the content of the show?

CodePudding user response:

refer to 7th floor yxjsd response:
Quote: refer to the sixth floor qq_19601709 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,


How will return results after adding the content of the show?
cycle append to the display position is good

CodePudding user response:

cycle append to the display position is good.


Circulation append ah, all I ask is: load the data synchronously, I append to add content to show, after changing asynchronous loading the data show not to come out, add the content is the console also does not have an error, why? How the whole?

CodePudding user response:

Has been solved, the selector by table: "last" to "# id" is ok, thank you,

CodePudding user response:

Local easyui 1.9.4 test no problem, is a version problem

CodePudding user response:

11 references, three dozen soy sauce response:
local easyui 1.9.4 test no problem, if version problem


Thank you very much! Resolved, the problem of the selector,
  •  Tags:  
  • Ajax
  • Related