JS open form operation class

Source: Internet
Author: User

/***********************************
* ***** Create Author: Let
* ***** Create datetime: 2011/04/22
* ***** Function description: operation class for opening a new window
***********************************/
Var winOperater = {
DefaultOpenOptions: {// window. open default values
Height: "500px", // window height
Width: "500px", // window degree
Left: "50px", // pixel value between the window and the left side of the screen
Top: "50px", // The pixel value from the window above the screen
Toolbar: "yes", // whether to display the toolbar
Menubar: "yes", // whether to display the menu bar
Resizable: "yes", // whether the window size can be changed
Scrollbars: "yes", // whether to display the scroll bar
Location: "no", // whether to display the address bar
Status: "no" // whether information in the status bar is displayed
},
DefaultShowOptions: {// window. ShowModelDialog default values
DialogHeight: "500px", // dialog height
DialogWidth: "500px", // degree of parallelism in the dialog box
DialogLeft: "PX", // distance from the left of the screen
DialogTop: "100px", // distance from the screen
Resizable: "yes", // whether the size can be changed
Center: "yes", // whether the window is centered
Status: "no", // whether the status bar is displayed
Scroll: "Yes", // indicates whether the scroll bar is displayed in the dialog box.
Help: "no" // whether to display the Help button
},
Winopen: function (URL) {// Open Mode
Window. Open (URL, "newwindow", this. getopenfeature ());
},
Winshowdialog: function (URL) {// mode window opening Mode
VaR OBJ = Window. showmodeldialog (URL, window, this. getshowfeature ());
Return OBJ;
},
Getwinopenobject: function () {// get window. Open parent form object
Return response opener.doc ument;
},
Getwinshowobject: function () {// obtain the window. showmodeldialog parent form object
Return response parent.doc ument;
},
Getopenfeature: function () {// retrieve the number of records set by window. Open
VaR arr = new array ();
For (VAR name in this. defaultopenoptions ){
Arr. Push (name + "=" + this. defaultopenoptions [name]);
}
Return arr. Join (",");
},
Setopenfeature: function (options) {// set the window. Open Parameter
If (Options = NULL) return;
For (var name in this. defaultOpenOptions ){
Var opt = options [name];
If (opt! = Undefined ){
This. defaultOpenOptions [name] = opt;
Delete opt [name];
}
}
For (var optName in options)
Eval ("this. defaultOpenOptions." + optName + "=/" "+ options [optName] + "/"");
},
GetShowFeature: function () {// specify the number of windows. showModelDialog to be retrieved.
Var arr = new Array ();
For (var name in this. defaultShowOptions ){
Arr. push (name + ":" + this. defashowshowoptions [name]);
}
Return arr. join (";");
},
SetShowFeature: function (options) {// set the window. showModelDialog Parameter
If (options = null) return;
For (var name in this. defaultShowOptions ){
VaR opt = options [name];
If (OPT! = Undefined ){
This. defaultshowoptions [name] = OPT;
Delete OPT [name];
}
}
For (VAR optname in options)
Eval ("This. defaultshowoptions." + optname + "=/" "+ options [optname] + "/"");
}
};

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.