页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。
评论: 增加了BusinessViewHandler.prototype.isEnabled方法

...

代码块
languagejs
linenumberstrue
var util = jsloader.resolve("freequery.common.util");
var BusinessViewHandler = function(businessView) {
	    this.businessView = businessView;
	    this.queryType = this.businessView.bv.queryType;
};
lang.extend(BusinessViewHandler, "freequery.widget.Module2");
 
BusinessViewHandler.prototype.destroy = function() {
	    BusinessViewHandler.superclass.destroy.call(this);
};
BusinessViewHandler.prototype.isEnabled = function(){
	return true;
} 
BusinessViewHandler.prototype.readConfig = function() {
	    var config = {
		
        toolbar : {
			
            items : [ {
				
                id : "saveEx",
				
                image : "img/save.gif",
				
                title : "保存",
				
                command : "SAVE_BUSINESS",//用于下面execute方法
				
                before : "save"
			            }]
		}
	};
	        }
    };
    return config;
};
BusinessViewHandler.prototype.execute = function(cmd, btn) {
	    switch (cmd) {
		
        case "SAVE_BUSINESS":
			
            try {
				
                this.businessView.onSave();
			
            }catch (e){
				break;
			}
			break;
	
                break;
            }
            break;
    }
};