Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[add] order of view handlers #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions sources/app.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import {JetApp, JetView, EmptyRouter } from "webix-jet";

import windows from "windows";
import appguard from "appguard";
import viewguard from "viewguard";
import pluginsunload from "plugins-unload";
import redirects from "redirects";
import viewresolve from "viewresolve";
import promises from "promises";
import routes from "routes";
import pluginslocale from "plugins-locale";
import pluginstheme from "plugins-theme";
import pluginsstatus from "plugins-status";
import routersurl from "routers-url";
import urlparams from "urlparams";
import screensize from "screensize";
import viewapp from "viewapp";
import tabbar from "tabbar";
import dashboard from "dashboard";
import addview from "addview";
import datatable from "datatable";
import webixview from "webixview";
import events from "./events";
import windows from "./windows";
import appguard from "./appguard";
import viewguard from "./viewguard";
import pluginsunload from "./plugins-unload";
import redirects from "./redirects";
import viewresolve from "./viewresolve";
import promises from "./promises";
import routes from "./routes";
import pluginslocale from "./plugins-locale";
import pluginstheme from "./plugins-theme";
import pluginsstatus from "./plugins-status";
import routersurl from "./routers-url";
import urlparams from "./urlparams";
import screensize from "./screensize";
import viewapp from "./viewapp";
import tabbar from "./tabbar";
import dashboard from "./dashboard";
import addview from "./addview";
import datatable from "./datatable";
import webixview from "./webixview";


const samples = new webix.DataCollection({ data:[
Expand All @@ -31,6 +32,7 @@ const samples = new webix.DataCollection({ data:[
{ group:1, value:"Resolving Files", app: viewresolve, id:"viewresolve" },
{ group:1, value:"Promises in views", app: promises, id:"promises" },
{ group:1, value:"Url Routes", app: routes, id:"routes" },
{ group:1, value:"View life-cycle", app: events, id:"events" },

{ group:2, value:"Locales", app: pluginslocale, id:"plugins-locale" },
{ group:2, value:"Themes", app: pluginstheme, id:"plugins-theme" },
Expand Down
93 changes: 93 additions & 0 deletions sources/events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import {JetApp, JetView} from "webix-jet";

class allowed extends JetView{
config(){
return { template:"Some cotent here" };
}
}
class PageA extends JetView{
config(){
return { template:"Here is Alpha" };
}

init(){
webix.message("init Alpha");
}
ready(){
webix.message("ready Alpha");
}
urlChange(){
webix.message("urlChange Alpha");
}
destroy(){
webix.message("destroy Alpha");
}
}
class PageB extends JetView{
config(){
return { template:"Here is Betta" };
}
init(){
webix.message("init Betta");
}
ready(){
webix.message("ready Betta");
}
urlChange(){
webix.message("urlChange Betta");
}
destroy(){
webix.message("destroy Betta");
}
}

class TopView extends JetView {
config(){
return {
type:"space", rows:[
{ view:"toolbar", cols:[
{ view:"label", label:"View life-cycle"}
]},
{
type:"wide",cols:[
{ view:"form", width: 200, rows:[
{ view:"button", value:"Page A", click:() =>
this.show("pageA") },
{ view:"button", value:"Page B", click:() =>
this.show("pageB") },
{ view:"button", value:"Destroy the app", click:() =>
this.app.destructor() },
{}
]},
{ $subview: true }
]
}
]
};
}
init(){
webix.message("init Top");
}
ready(){
webix.message("ready Top");
}
urlChange(){
webix.message("urlChange Top");
}
destroy(){
webix.message("destroy Top");
}
}


const app = new JetApp({
id: "windows",
start: "/top/pageA",
views:{
top: TopView,
pageA: PageA,
pageB: PageB
}
});

export default app;