Procházet zdrojové kódy

上下文种添加 getParentEnvirment

unknown před 5 roky
rodič
revize
434611052a

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

@@ -756,6 +756,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
         "selectAll" : function () { return _form.selectAll(); },
         "selectAll" : function () { return _form.selectAll(); },
         "unSelectAll" : function () { return _form.unSelectAll(); },
         "unSelectAll" : function () { return _form.unSelectAll(); },
         "getSelectedData" : function () { return _form.getSelectedData(); },
         "getSelectedData" : function () { return _form.getSelectedData(); },
+        "setFilter" : function ( filter ) { return _form.setFilter(filter); },
         "switchView" : function ( options ) { return _form.switchView(options); },
         "switchView" : function ( options ) { return _form.switchView(options); },
 
 
         // "getInfor": function () { return ev.pageInfor; },
         // "getInfor": function () { return ev.pageInfor; },

+ 7 - 1
o2web/source/x_component_query_Query/Viewer.js

@@ -787,6 +787,12 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
             })
             })
         }
         }
     },
     },
+    setFilter : function( filter ){
+        if( !filter )filter = [];
+        if( typeOf( filter ) === "object" )filter = [ filter ];
+        this.json.filter = filter;
+        this.createViewNode({"filterList": this.json.filter  ? this.json.filter.clone() : null});
+    },
     switchView : function( json ){
     switchView : function( json ){
         debugger;
         debugger;
         // json = {
         // json = {
@@ -807,7 +813,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
 
 
         var newJson = Object.merge( Object.clone(this.originalJson), json );
         var newJson = Object.merge( Object.clone(this.originalJson), json );
         this.container.empty();
         this.container.empty();
-        this.initialize( this.container, newJson, Object.clone(this.options), this.app);
+        this.initialize( this.container, newJson, Object.clone(this.options), this.app, this.parentMacro);
     },
     },
     confirm: function (type, e, title, text, width, height, ok, cancel, callback, mask, style) {
     confirm: function (type, e, title, text, width, height, ok, cancel, callback, mask, style) {
         this.app.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style)
         this.app.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style)