A modal dialog box using AJAX?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
3 views
The problem:


There is a certain function (the 20th on the list in the call stack). It causes a modal window.

When corresponding GUI to the Web UI, the question arose of implementation modality via AJAX.


To give the window the browser, you need to terminate a thread, in which you launch the modal window.

To complete the flow, you need to get the results of the dialog box. That's the essence of the problem.


Two failed solutions:


1. Cut all 20 functions into 2 parts. All of that to the modal window, the window itself is given and is fulfilled in the first thread.

All that after in the second. Cut function 2 is necessary in order to be able to share "before" and "after".


2. To stop the flow, which reached a modal window. Create a second thread that gives the browser the modal window. On return from the modal window, restore the first thread.


The first option will break the object-oriented, labor-intensive. The second option is difficult to implement, requires a low level of operation and intervention in already existing modules.


Is there any option pharmaline?
by | 3 views

2 Answers

0 like 0 dislike
Do via the callback... If you need the data above in the callback function raise to a higher level...
\r
there was a problem:
// actions to the dialogue...
var result = dialog.showModal(params);
// actions after the dialogue...
\r
became a problem:
\r
// actions to the dialogue...
dialog.showModal(params, function(result){
// actions after the dialogue...
});
by
0 like 0 dislike
If I understand you correctly, it is possible to help view implementation of the async = false in the method .ajax framework jQuery.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Jun 7, 2019 by mQExcellent
110,608 questions
257,186 answers
0 comments
25,732 users