Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript sencha面板覆盖了我试图放置在它下面的内容。日期选择器和组合框_Javascript_Extjs_Combobox_Datepicker - Fatal编程技术网

Javascript sencha面板覆盖了我试图放置在它下面的内容。日期选择器和组合框

Javascript sencha面板覆盖了我试图放置在它下面的内容。日期选择器和组合框,javascript,extjs,combobox,datepicker,Javascript,Extjs,Combobox,Datepicker,我想把一个组合框放在一个日期选择器下面,但是当我把它放在一个容器中时,我设法用我的组合框覆盖了这个日期选择器。datePicker设置为面板,在Hbox布局中,我尝试将其更改为vBox布局,但没有帮助。有办法解决这个问题吗 这是我的密码: .......................... items: [{ xtype: 'container', items: [{ xtype: 'comboBox',

我想把一个组合框放在一个日期选择器下面,但是当我把它放在一个容器中时,我设法用我的组合框覆盖了这个日期选择器。datePicker设置为面板,在Hbox布局中,我尝试将其更改为vBox布局,但没有帮助。有办法解决这个问题吗

这是我的密码:

..........................
items: [{
        xtype: 'container',
        items: [{
                xtype: 'comboBox',
                fieldLabel: 'Choose Calendar',
                reference: 'chooseCalendar',
                editable: false,
                displayField: 'title',
                valueField: 'title',
                queryMode: 'local'
               }]
      }],
      datePickerCfg: {
              reference: 'datePicker',
              flex: 3,
             },
 ........................
datePicker位于另一个文件的构造函数中

 ........................
    layout: {
    type: 'hbox',
    pack: 'start',
    align: 'stretch'
},
constructor: function(config) {
    var newConfig = {
            items: config.items || []
        },
        datePicker = {
            xtype: 'datepicker'
        },
        checkBoxes = {
            xtype: 'checkboxgroup'
        };
    if (config.datePickerCfg) {
        datePicker = Ext.apply(datePicker, config.datePickerCfg);
        newConfig.items.push(datePicker);
    }
    checkBoxes = Ext.apply(checkBoxes, config.checkBoxes);
    newConfig.items.push(checkBoxes);

    this.callParent([Ext.apply(newConfig, config)]);

我的一个朋友在我之前找到了一个方法,grrr。但是在这里

datePickerPanelCfg: {
            xtype: 'container',
            reference: 'datePickerPanelRef',
            items: [{
                xtype: 'datepicker'
            }, {
                xtype: 'combobox',
                    fieldLabel: 'Choose Calendar',
                    reference: 'chooseCalendar',
                    editable: false,
                    bind: {
                        store: '{calendars}'
                    },
                    displayField: 'title',
                    valueField: 'title',
                    queryMode: 'local'
                }, {
                    xtype: 'colorpicker',
                    valueField: 'value',
                    reference: 'colorPickerRef',
                    listeners: {
                        'select': 'colorPicker'
                    }
                 }]
              }]
带有构造函数的文件中添加了以下代码

layout: {
    type: 'hbox',
    pack: 'start',
    align: 'stretch'
},
constructor: function(config) {
    var newConfig = {
            items: config.items || []
        },
        calendarPanel = {
            xtype: 'calendarpanel'
        },
        datePickerPanel = {
            xtype: 'container',
            layout: {
                type: 'vbox'
            },
            renderTo: Ext.getBody(),
            border: 1,
            style: {
                borderColor: '#000000',
                borderStyle: 'solid',
                borderWidth: '1px'
            },
            items: [{
                xtype: 'datepicker'
            }, {
                xtype: 'checkboxgroup'
            }, {
                xtype: 'container'
            }]

        };
    if (config.datePickerCfg) {
        datePicker = Ext.apply(datePicker, config.datePickerCfg);
        newConfig.items.push(datePicker);
    }

    datePickerPanel = Ext.apply(datePickerPanel, config.datePickerPanelCfg);
    newConfig.items.push(datePickerPanel);

    calendarPanel = Ext.apply(calendarPanel, config.calendarPanelCfg);
    newConfig.items.push(calendarPanel);

    this.callParent([Ext.apply(newConfig, config)]);
你能添加一个sencha来帮助你更好吗?