Javascript.RU

Создать новую тему Ответ
 
Опции темы Искать в теме
  #1 (permalink)  
Старый 20.12.2018, 13:09
Интересующийся
Отправить личное сообщение для Postgeograph Посмотреть профиль Найти все сообщения от Postgeograph
 
Регистрация: 08.11.2018
Сообщений: 14

Вывести панель на 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'
	  });
	  
  }
});
Ответить с цитированием
  #2 (permalink)  
Старый 20.12.2018, 17:15
Интересующийся
Отправить личное сообщение для Postgeograph Посмотреть профиль Найти все сообщения от Postgeograph
 
Регистрация: 08.11.2018
Сообщений: 14

собственно теперь нужно понять как работает viewport при инициировании данной функции. Он создает новый viewport. Как управлять его конфигурацией (размер и тд)? Как ининциировать создание класса на существующем viewport?
Ответить с цитированием
Ответ



Опции темы Искать в теме
Искать в теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Открывающая панель kuller jQuery 0 06.09.2016 18:58
Как передать данные в другую панель из выбранной строки таблицы. layout: 'card'. Пролетарий ExtJS 5 03.06.2015 22:53
Статическая панель. pekinessik jQuery 0 08.01.2014 22:10
панель в панель из панели и снова в панель bessss ExtJS 6 04.09.2011 12:59
Дополнительная панель в визивике. Прошу советов orlenkokn jQuery 0 25.01.2010 11:44