Today, the ymprompt win method is used to pop up a window. Because we need to use the value returned from the subwindow to determine whether to refresh the parent window, we have not found a proper method in the ymprompt component demo. I am very depressed and still don't have to worry about it, I checked the introduced method from the beginning to the end, and saw two parameters sign and autoclose in dohandler. After reading the method introduction, I thought this method was feasible (previously I used ymprompt. Close method to close the subwindow directly ), And write a script to test it. Code Post as follows:
Parent window code:
Function viewsubfeedetail (feeid)
{
Ymprompt. Win ({message: 'viewsubfeedetail. Action? Feeid = '+ feeid, Handler: callback, width: 800, height: 400, Title: 'tariff details information', IFRAME: true })
}
Function callback (TP)
{
Alert (TP );
}
Subwindow code:
Function closewin ()
{
Window. Parent. ymprompt. dohandler ('error', true );
}
In this way, when the subwindow button triggers closewin, the "error" value is returned to the TP parameter of the callback function of the parent window. The true parameter is to automatically close the subwindow.
Appendix: ymprompt-related materials
Demo address: http://www.ajaxbbs.net/test/ymPrompt4.0/demo.html
Introduction and: http://www.ajaxbbs.net/post/product/ymPrompt4.0.html
Website: http://www.ajaxbbs.net/
Today, the ymprompt win method is used to pop up a window. Because we need to use the value returned from the subwindow to determine whether to refresh the parent window, we have not found a proper method in the ymprompt component demo. I am very depressed and still don't have to worry about it, I checked the introduced method from the beginning to the end, and saw two parameters sign and autoclose in dohandler. After reading the method introduction, I thought this method was feasible (previously I used ymprompt. Close method to close the subwindow directly ), Write a script for testing, and you can implement what I want. The code is now pasted as follows:
Parent window code:
Function viewsubfeedetail (feeid)
{
Ymprompt. Win ({message: 'viewsubfeedetail. Action? Feeid = '+ feeid, Handler: callback, width: 800, height: 400, Title: 'tariff details information', IFRAME: true })
}
Function callback (TP)
{
Alert (TP );
}
Subwindow code:
Function closewin ()
{
Window. Parent. ymprompt. dohandler ('error', true );
}
In this way, when the subwindow button triggers closewin, the "error" value is returned to the TP parameter of the callback function of the parent window. The true parameter is to automatically close the subwindow.
Appendix: ymprompt-related materials
Demo address: http://www.ajaxbbs.net/test/ymPrompt4.0/demo.html
Introduction and: http://www.ajaxbbs.net/post/product/ymPrompt4.0.html
Website: http://www.ajaxbbs.net/