Как правильно называть накладные панели Ext JS? - PullRequest
0 голосов
/ 06 марта 2019

Хочу вызвать 2 формпанели с кнопок основного контроллера. Но после добавления компонента меню я сталкиваюсь со следующим событием: если я выбрал первый оверлей, он будет сдан в аренду, когда я выберу второй оверлей. И наоборот, когда я выбрал второй. он будет арендовать, когда я пытаюсь вызвать 1-й оверлей Так что же случилось? Какая-то проблема с этим?

мои кнопки на главной:

...
    items:[{
                text:'+Cut',
                ui:'action',
                cls: 'grbuttons',
                height: 35,
                width: 150,
                margin:2,
                handler:'cutForms'
            },{
                text:'+Agree',
                ui:'action',
                cls: 'grbuttons',
                margin:2,
                height: 35,
                width: 145,
                handler: 'agreeForm'
            },
...

код моего контроллера:

...
    cutForms: function() {
        if (!this.overlay) {
            this.overlay = Ext.Viewport.add({
                xtype: 'foresto-cutarea',
                scrollable: true,
                renderTo: Ext.getBody(),
                height:'55%',
                margin: '208 98 200 215',
                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();
    },

    agreeForm: function() {
        if (!this.overlay) {
            this.overlay = Ext.Viewport.add({
                xtype: 'foresto-agreement',
                renderTo: Ext.getBody(),
                height:'82%',

                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();
    },
...

Пример кода моей формы:

Ext.define('Foresto.view.forms.Agreement', {
    extend: 'Ext.form.Panel',
    title: 'Договор',
    header: {
       cls: 'hdr2'

    },
    scrollable: true,

    scope: this,
    xtype: 'foresto-agreement',
    id:'foresto-agreement',
    defaults: {
        xtype: 'textfield',
        labelWrap: true,
        required: true, // *
        afterLabelTextTpl: [
            '<span style="color:red;font-weight:normal" data-qtip="Required">*</span>'
        ]
    },
    items: [{...

Так как использовать несколько или несколько (не только одну) накладных панелей? как решить эту проблему?

...