Вывести панель на mainview
Добрый день. Не могу вывести panel на mainview.
Использовал Ext.viewport.add (в коде) и Ext.create, но панель так и не рентрится.. Вопросы: 1) как вывести новую панель на mainview, и что бы она загружалась сразу с запуском приложения 2) каким способом вывода классов на вьюпорт лучше пользоваться? Ext.define('Foresto.view.main.Main', { extend: 'Ext.form.Panel', id:"control-panel", plugins: 'responsive', responsiveConfig:{ tall:{ tabPosition:'center' } }, xtype: 'app-main', controller:'menuform', requires: [ 'Foresto.view.map.Map', 'Foresto.view.main.ButtonController', 'Foresto.view.forms.LoginRoom' ], autosize:true, padding: 0, id:"bighBox", header: { cls: 'header-cls', title : { cls : 'header-title-cls', text : 'ЛЕС' } }, tools: [{ type: 'menu', handler: function() { Ext.Viewport.toggleMenu('top'); } }], items:[{ xtype: 'carousel', id: "mainPart", flex: 1, defaults: { border: true, ui: 'light' }, items: [/*{ layout: { type: 'box', align: 'middle', pack: 'center' }, cls: 'colorful2', defaults: { border: true, ui: 'light', flex: 1 }, autoFill:true, items:[{ title: 'Карта', id:'mapId', xtype: 'panel', layout:'vbox', padding: 0, items: [{ xtype: 'foresto-map' }] },{ title: 'Отчетность', xtype: 'panel', cls: 'foresBack', layout: { type: 'hbox', align: 'middle', pack: 'center' }, items:[{ xtype:'button', cls:'threethbutton', ui: 'confirm', text:'Получить отчёт I-ИЛ', margin:'10px' },{ xtype:'button', cls:'threethbutton', ui: 'confirm', text:'Получить отчёт I-ВЛ' }] }] },{ xtype: 'panel', header: { cls: 'header-cls', title : { cls : 'header-title-cls', text : 'Управление' } }, layout: 'fit', items:[{ xtype: 'carousel', direction: 'vertical', items: [{ styleHtmlContent: true, layout: { type: 'card', align: 'center' }, items: [{ xtype:'button', ui: 'standart', cls: 'buttonView', text: 'Ввод информации', id: 'EnterInfoId', handler: function () { Ext.create('Ext.panel.Panel', { autoshow: true, items: [{ xtype:'foresto-enterInfo' }] }).show(); } }] }, { style: 'background-color: #6C9D5D', styleHtmlContent: true, layout: { type: 'card', align: 'center' }, items: [{ xtype:'button', cls: 'buttonView', text: 'Просмотр' }] }] }], hidden: true, border: true, width: '18%' }], initialize: function() { Ext.Viewport.setMenu(this.getMenuCfg('top'), { side: 'top' }); }, doDestroy: function() { Ext.Viewport.removeMenu('top'); this.callParent(); }, getMenuCfg: function(side) { return { items: [{ text: 'ВОЙТИ', iconCls: 'x-fa fa-pencil', ui:'confirm', modal: true, hideOnMaskTap: true, scope: this, handler: function() { if (!this.overlay) { this.overlay = Ext.Viewport.add({ xtype: 'login', renderTo: Ext.getBody(), fullscreen: true, modal: true, hideOnMaskTap: true, showAnimation: { type: 'popIn', duration: 250, easing: 'ease-out' }, hideAnimation: { type: 'popOut', duration: 250, easing: 'ease-out' }, centered: true, width: Ext.filterPlatform('ie10') ? '100%' : (Ext.os.deviceType == 'Phone') ? 260 : 400, maxHeight: Ext.filterPlatform('ie10') ? '100%' : (Ext.os.deviceType == 'Phone') ? 220 : 400, scrollable: true }); } this.overlay.show(); } }] }; }, launch: function() { app-main.add({ xtype:'panel', // вывести данную панель на mainview title:'test' }); } }); |
собственно теперь нужно понять как работает viewport при инициировании данной функции. Он создает новый viewport. Как управлять его конфигурацией (размер и тд)? Как ининциировать создание класса на существующем viewport?
|
Часовой пояс GMT +3, время: 02:49. |