Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Layout = new dhtmlXLayoutObject(document.body,"2U","dhx_skyblue");
- MainLayout = Layout.cells('b');
- SidebarTree.attachEvent("onClick", function(id) {
- var view = SidebarTree.getUserData(id,"view");
- var ctrl = SidebarTree.getUserData(id,"controller");
- var status = false;
- if (view === undefined) {
- status = MainLayout.showView('def');
- }
- else {
- status = MainLayout.showView(view);
- if (Views[view] === undefined) {
- Views[view] = id;
- Load(true);
- }
- }
- if (status) {
- if (App[ctrl] !== undefined && typeof App[ctrl].index === 'function') {
- App[ctrl].index();
- }
- else {
- console.warn("Controller not loaded or don't have index method.");
- }
- }
- });
- And My "Controller":
- App.Tlist = {
- index: function() {
- if (this.Ribbon === undefined) {
- this.Ribbon = MainLayout.attachRibbon();
- this.Ribbon.loadStruct(BASEURL + "tlist/loader/ribbon",function() {
- var fromInput = App.Tlist.Ribbon.getInput('calendarFrom');
- var toInput = App.Tlist.Ribbon.getInput('calendarTo');
- $(fromInput).height(17);
- $(toInput).height(17);
- var Calendar = new dhtmlXCalendarObject([fromInput,toInput]);
- Calendar.setDateFormat('%Y-%m-%d %H:%i');
- });
- }
- Load(false);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement