Do not refresh the page after submission

One problem:
the project using dwz be playing boxes and the page jump master for the first page, select a master data click on the button to see the details, the pop-up the second page details page (the page pop-up box), in the second total pages click the Add button to bring up the third page to add a page, after data is successfully added to the add page, turn off automatically add the current page back to the first second page details page, then the details page does not refresh (refreshed page)
solution ( has been resolved, at the end of the project controller layer plus method ajaxObject.setMessage ( "return success"); after this code, it will automatically close the popup box ) :

1  // increase in the second page in a query form, id is bbform, id is added to the form aaform, in the third page 
2  // submit the form onclick event changed submitted by js, code: 
3  function AA () {
 . 4          $ ( "# aafrom" ) .submit ();
 . 5          $ ( "# bbform" ) .submit ();
 . 6      }
 . 7  // explained, each time the form is submitted aaform, will be submitted once the second page bbform form, bbform form for the query function, 
8  // this can be achieved when each submission aaform second page will execute a query through the process

note! This method refresh the form sometimes fail because two asynchronous submission form submission, modified in two ways:
1. In the first form intermediate submitted after 0.5 seconds pause submit the second form (not recommended)
2 Close asynchronous submission (recommended)

1 function aa(){
2         $.ajaxSettings.async = false;
3         $("#aafrom").submit();
4         $("#bbform").submit();
5         $.ajaxSettings.async = true;
6     }

Second problem: the
master for the first page, select a master data click on the button to see the details, the pop-up the second page details page (the page pop-up), while in the second the total page hits (review / delete) button, (review / delete) the second page does not refresh automatically after complete
solution:

1  // After (review / delete) feature uses ajax request implementation, the request is successful, the status of 200 successful operation instructions, then refresh the page designated 
2  function deleteDetail (the above mentioned id) {
 3      layer.confirm ( "OK to delete it?", Function (index) {
 . 4          $ .ajax ({
 . 5              URL: "$ {} CTX / fcHydrantDetail / detaildelete /" + ID,
 . 6              dataType: 'JSON' ,
 . 7              Success: function (RST) {
 . 8                  IF (== rst.statusCode '200 is' ) {
 . 9                      var loadingIndex = Dialog.load ();
 10                     top.layer.msg ( "deleted successfully!", {icon:. 1 });
 . 11                     $('#FcHydrantDialog11').load($('#FcHydrantDialog11').find('#pagerForm').attr('action'), $('#FcHydrantDialog11').find('#pagerForm').serializeArray(), function() {
12                    //layer.close(loadingIndex);
13                    });
14                 }else{
15                      top.layer.msg("删除失败!", {icon : 2});
16                     }
17             }
18         });
19     })
20 }

note,

$ ( '# FcHydrantDialog11'). Load ($ ( '# FcHydrantDialog11'). Find ( '# pagerForm'). Attr ( 'action'), $ ( '# FcHydrantDialog11'). Find ( '# pagerForm'). SerializeArray (), function () {}); refresh operation, if the page has a form for the inquiry form, then, can be $ ( "# search") submit ();. form form submission refresh operation is executed

Guess you like

Origin www.cnblogs.com/zeevy/p/12118446.html