Răsfoiți Sursa

自定义视图

unknown 5 ani în urmă
părinte
comite
4c8609a6b7

+ 5 - 4
o2web/source/o2_core/o2/widget/Paging.js

@@ -198,7 +198,7 @@ o2.widget.Paging = new Class({
         var _self = this;
         var pageJumper = this.pageJumper = new Element("input.pageJumper", {
             "styles": this.css.pageJumper,
-            "title": "输入页码,按回车跳转"
+            "title": "输入页码,离开输入框或按回车跳转"
         }).inject(this.node);
         this.pageJumperText = new Element("div.pageText", {
             "styles": this.css.pageJumperText,
@@ -209,10 +209,11 @@ o2.widget.Paging = new Class({
                 ev.target.setStyles(this.css.pageJumper_over)
             }.bind(this),
             "blur": function (ev) {
-                ev.target.setStyles(this.css.pageJumper)
-            }.bind(this),
+                if( this.value )_self.gotoPage(this.value);
+                ev.target.setStyles(_self.css.pageJumper);
+            },
             "keyup": function (e) {
-                this.value = this.value.replace(/[^0-9_]/g, '')
+                this.value = this.value.replace(/[^0-9_]/g, '');
             },
             "keydown": function (e) {
                 if (e.code == 13 && this.value != "") {

+ 1 - 1
o2web/source/o2_core/o2/xScript/ViewEnvironment.js

@@ -772,7 +772,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
         // },
         // "getField": function (name) { return _forms[name]; },
         // "getAction": function () { return _form.workAction },
-        "getDesktop": function () { return _form.app.desktop },
+        "getDesktop": function () { return _form.app ? _form.app.desktop : null},
         // "getData": function () { return new MWF.xScript.JSONData(_form.getData()); },
         //"save": function(callback){_form.saveWork(callback);},
         // "close": function () { _form.closeWork(); },