/**
* 用户管理
*/
var leftSchoolModule = function (o) {
this.module = "leftSchool",
this.action = "leftSchool",
this.moduleId = "#leftSchoolHomeArticle",
this.articleId = "",
this.tabActive = null,
this.deferred = {},
this.debug = false,
this.format = o;
};
/**
* 渲染主页布局
*/
leftSchoolModule.prototype.home = function(o) {
this.articleId = "Home";
renderTplUrl = null,
renderTpl = {renderObj:leftSchool.moduleId, renderOnObj:"", renderHtml:iyyIV +"/modules/ihr/leftSchool/html/leftSchoolHome.html"};
icmInit.renderTpl({'renderTplUrl':renderTplUrl,'renderTpl':renderTpl,'deferred':$.Deferred()});
};
leftSchoolModule.prototype.searchGridRows = function(o) {
if("object" != typeof o)return;
$(leftSchool.moduleId).off('submit').on('submit',o.renderTpl.renderOnObj, o, function(event, state) {
event.preventDefault();// 阻止a链接的跳转行为
leftSchool.articleId = "ModuleGrid",searchDeferred={},arrList= new Array();
arrList.push(o.renderTplUrl.params);
arrList.push(icmInit.serializeForm({'_this':$(this),'type':'json'}));
o.renderTplUrl.params = icmInit.merge({type:"json",arrList:arrList});
leftSchool.modualGrid({renderTplUrl:o.renderTplUrl,renderTpl:o.renderTpl});//渲染右侧table栏
//前置请求条件
event.stopPropagation(); // 是停止事件传递 , 并不影响它后面的代码执行。
return ;
});
};
js的面向对象编程prototype
http://www.cnblogs.com/yjf512/archive/2011/06/03/2071914.html
第一个是面向对象编程 ,定义一个类,里面是属性
第二个,第三个是在这个对象的原型上扩展一个名为name searchGridRows方法,里面的一些变量等,要看是在哪里声明的,由于用了不少全局变量,
兄dei把js高程前七章看完理解就没有问题
这只是面向对象的写法而已