Does anyone use the PHP + DWZ framework as the background?
Source: Internet
Author: User
Is someone using the PHP + DWZ framework as the background? Recently, we used DWZ as the background and found that the Tab jump was always unsuccessful. The official documents mentioned above are too simple. Have you ever written related examples? After I submit the FORM, I can't skip back in JSON format... official statement: DWZ & nbsp; form submission dwz. ajax. js · & n is someone using the PHP + DWZ framework as the background?
Recently, we used DWZ as the background and found that the Tab jump was always unsuccessful. The official documents mentioned above are too simple. Have you ever written related examples? After I submit the FORM, I can't skip back in JSON format...
Official statement:
DWZ form submission dwz. ajax. js
· The default callback function is automatically called after the Ajax form is submitted. a message indicating successful or failed operations is displayed.
Add onsubmit = "return validateCallback (this) on the Form tag );
· If you need to re-load a navTab or close the dialog after submitting an Ajax form, you can use the method navTabAjaxDone/dialogAjaxDone defined in dwz. ajax. js.
Note: If the form uses navTabAjaxDone on the navTab page, the form uses dialogAjaxDone on the dialog page.
Add onsubmit = "return validateCallback (this, navTabAjaxDone)" to the Form tag )"
Or onsubmit = "return validateCallback (this, dialogAjaxDone )"
· If you need to do some other processing after submitting an Ajax form, you can also customize a callback function xxxAjaxDone. For example, close the current navTab after the following form is submitted successfully, or re-load a tab.
Add onsubmit = "return validateCallback (this, xxxAjaxDone)" to the Form tag )"
Server response
After the Ajax form is submitted, the server must return the following json code:
{
"StatusCode": "200 ",
"Message": "Operation successful ",
"NavTabId ":"",
"Rel ":"",
"CallbackType": "closeCurrent ",
"ForwardUrl ":""
}
The following are the navTabAjaxDone and dialogAjaxDone code snippets defined in dwz. ajax. js:
/**
* NavTabAjaxDone is a pre-defined form submission callback function in the DWZ framework.
* If the server returns navTabId, it can mark the navTab as reloadFlag = 1. the content will be reloaded the next time it switches to that navTab.
* If callbackType is closeCurrent, the current tab is closed.
* The forwardUrl value is required only when callbackType = "forward ".
* The navTabAjaxDone callback function is basically generic. you can also customize the callback function if you have special requirements.
* If the form submission only prompts whether the operation is successful, the callback function is not specified. The framework calls DWZ. ajaxDone () by default ()
*
*
* After the form is submitted, return the json data structure statusCode = DWZ. statusCode. OK, indicating that the operation is successful. perform operations such as page jump. statusCode = DWZ. statusCode. error indicates that the operation fails and the error cause is prompted.
* StatusCode = DWZ. statusCode. timeout indicates that the session times out. the next time you click it, it will jump to DWZ. loginUrl.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service