Просмотр исходного кода

日期选择空间增加事件

unknown 5 лет назад
Родитель
Сommit
412bd9e1bc

+ 105 - 96
o2web/source/x_component_process_FormDesigner/Module/Calendar/template.json

@@ -1,98 +1,107 @@
 {
-	"id": "",
-	"name": "",
-	"type": "Calendar",
-	"description": "",
-	"defaultValue": {
-		"code": "",
-		"html": ""
-	},
-	"range": "single",
-	"selectType": "datetime",
-	"format": "%Y-%m-%d %H:%M:%S",
-    "compute": "create", //create, show, save
-    "section": "no",
-    "sectionBy": "person",
-    "sectionByScript": {
-      "code": "",
-      "html": ""
-    },
-	"events": {
-	  "queryLoad": {
-		"code": "",
-		"html": ""
-	  },
-	  "postLoad": {
-		"code": "",
-		"html": ""
-	  },
-	  "load": {
-		"code": "",
-		"html": ""
-	  },
-	  "complete": {
-		"code": "",
-		"html": ""
-	  },
-	  "clear": {
-		"code": "",
-		"html": ""
-	  },
-		"click": {
-			"code": "",
-			"html": ""
-		},
-		"dblclick": {
-			"code": "",
-			"html": ""
-		},
-		"change": {
-			"code": "",
-			"html": ""
-		},
-		"keydown": {
-			"code": "",
-			"html": ""
-		},
-		"keypress": {
-			"code": "",
-			"html": ""
-		},
-		"keyup": {
-			"code": "",
-			"html": ""
-		},
-		"mousedown": {
-			"code": "",
-			"html": ""
-		},
-		"mousemove": {
-			"code": "",
-			"html": ""
-		},
-		"mouseout": {
-			"code": "",
-			"html": ""
-		},
-		"mouseover": {
-			"code": "",
-			"html": ""
-		},
-		"mouseup": {
-			"code": "",
-			"html": ""
-		},
-		"focus": {
-			"code": "",
-			"html": ""
-		},
-		"blur": {
-			"code": "",
-			"html": ""
-		}
-	},
-	"properties": {},
-	"class": "",
-	"styles": {},
-	"container": ""
+  "id": "",
+  "name": "",
+  "type": "Calendar",
+  "description": "",
+  "defaultValue": {
+    "code": "",
+    "html": ""
+  },
+  "range": "single",
+  "selectType": "datetime",
+  "format": "%Y-%m-%d %H:%M:%S",
+  "compute": "create",
+  //create, show, save
+  "section": "no",
+  "sectionBy": "person",
+  "sectionByScript": {
+    "code": "",
+    "html": ""
+  },
+  "events": {
+    "queryLoad": {
+      "code": "",
+      "html": ""
+    },
+    "postLoad": {
+      "code": "",
+      "html": ""
+    },
+    "load": {
+      "code": "",
+      "html": ""
+    },
+    "complete": {
+      "code": "",
+      "html": ""
+    },
+    "clear": {
+      "code": "",
+      "html": ""
+    },
+    "show": {
+      "code": "",
+      "html": ""
+    },
+    "hide": {
+      "code": "",
+      "html": ""
+    },
+    "click": {
+      "code": "",
+      "html": ""
+    },
+    "dblclick": {
+      "code": "",
+      "html": ""
+    },
+    "change": {
+      "code": "",
+      "html": ""
+    },
+    "keydown": {
+      "code": "",
+      "html": ""
+    },
+    "keypress": {
+      "code": "",
+      "html": ""
+    },
+    "keyup": {
+      "code": "",
+      "html": ""
+    },
+    "mousedown": {
+      "code": "",
+      "html": ""
+    },
+    "mousemove": {
+      "code": "",
+      "html": ""
+    },
+    "mouseout": {
+      "code": "",
+      "html": ""
+    },
+    "mouseover": {
+      "code": "",
+      "html": ""
+    },
+    "mouseup": {
+      "code": "",
+      "html": ""
+    },
+    "focus": {
+      "code": "",
+      "html": ""
+    },
+    "blur": {
+      "code": "",
+      "html": ""
+    }
+  },
+  "properties": {},
+  "class": "",
+  "styles": {},
+  "container": ""
 }

+ 3 - 2
o2web/source/x_component_process_Xform/Calendar.js

@@ -4,7 +4,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar =  new Class({
 	Extends: MWF.APP$Input,
 	iconStyle: "calendarIcon",
     options: {
-        "moduleEvents": ["queryLoad","postLoad","load","complete", "clear", "change"]
+        "moduleEvents": ["queryLoad","postLoad","load","complete", "clear", "change","show","hide"]
     },
     _loadNode: function(){
         if (this.readonly || this.json.isReadonly){
@@ -78,10 +78,11 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar =  new Class({
                                 //offset : { y : -25 }
                             });
                         }
-
+                        _self.fireEvent("show");
                     },
                     "onHide": function(){
                         if (!this.node.getFirst().get("value")) if (this.descriptionNode)  this.descriptionNode.setStyle("display", "block");
+                        _self.fireEvent("hide");
                     }.bind(this)
                 };
                 options.baseDate = this.getBaseDate();