需要侧边栏的时候 比如 左边框 右边框 要新建首页页面。
首页页面里的WING就等于翅膀的意思 left 是左边栏 right是右边栏。
里面有个main 下有个mainContaier里有src 就是页面调度的意思 说白了就是要打开时加载显示哪个页面 。
常用打开页面的方法就是justep.Shell.showPage();
shell 打开页面的方法 用的时候需要引入
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var ShellImpl = require('$UI/system/lib/portal/shellImpl');
一般只要建了首页页面 就会自动加载。 有个shell引用就可以用shell 做操作了比如打开页面 打开左栏。
var Model = function() {
this.callParent();
this.shellImpl = new ShellImpl(this, {
contentsXid : "pages",
wingXid : "wing",
pageMappings : {
"main" : {
url : require.toUrl('./list.w')//也可以直接把红色的这句直接当showPage()括号里的参数。
}
}
});
};
Model.prototype.modelLoad = function(event) {
justep.Shell.showPage("main");
};
比如上面的 用shell.showPage 方法在model组件加载时 打开main页面。
下面就是在分类设置按钮的打开分类设置页面的例子
Model.prototype.classSetBtn = function(event){
justep.Shell.showPage(require.toUrl('./classseting.w'));
};
//注意 这里的require.toUrl('./classseting.w'))就是通过justep.shell.showPage方法打开页面的方法。
还可以用另外的一种就是在定义一个上面的pageMappings 然后在showPage()的参数直接用定义的变量 比如main
下面是显示左边框:
Model.prototype.backBtnClick = function(event){
justep.Shell.showLeft();
};