在dockedItems中折叠过滤器面板

时间:2015-08-18 08:53:27

标签: forms extjs filter panel collapse

你好,我在试图折叠我的过滤器面板时停止使用停靠的物品,但这个最令人工作的工作也是错误的一面,有人知道如何解决它。我创建一个getFilterPane并将其作为工具栏项在initComponenet中返回。

Ext.define('Shopware.apps.SDG.view.update.Grid', {
extend: 'Ext.grid.Panel',
region: 'center',
collapsible: false,
split: true,
title: 'Update Log',
getPagingBar: function () {
var me = this;
me.store = Ext.create('Shopware.apps.SdgArticleUpdateImportLog.store.SdgArticleUpdateLog');
return Ext.create('Ext.toolbar.Paging', {
    store: me.store,
    dock: 'bottom',
    displayInfo: true,
    region: 'south'
});
},
getFilterPanel: function () {
var me = this;
return  Ext.create('Ext.form.Panel', {
    store: me.store,
    title: 'Filters',
    collapsible: true,
    cls: 'detail-view',
    width: 300,
    region: 'east',
    dock: 'right',
    layout: {
    type: 'vbox',
    pack: 'start',
    align: 'stretch'
    },
    defaultType: 'textfield',
    items: [{
        fieldLabel: 'Sku',
        name: '1',
        allowBlank: true,
        listeners: {
        change: function (field, value) {
            me.store.filter('sku', value);
            me.store.filters.clear();
        }
        }
    }, {
        fieldLabel: 'Timestamp',
        name: '2',
        allowBlank: true,
        listeners: {
        change: function (field, value) {
            me.store.filter('importTimestamp', value);
            me.store.filters.clear();
        }
        }
    }]
});
},
createFilterPanel: function () {
},
initComponent: function () {
var me = this;
me.dockedItems = [me.getPagingBar(), me.getFilterPanel(),
    {
    xtype: 'toolbar',
    dock: 'top',
    items: [
        , '->',
        {
        xtype: 'textfield',
        name: 'searchfield',
        cls: 'searchfield',
        width: 175,
        emptyText: '{s name="CoeSeoRoute/Toolbar/Search"}Suche{/s}',
        enableKeyEvents: true,
        clearable: true,
        checkChangeBuffer: 500,
        listeners: {
            change: function (field, value) {
            me.store.filter('search', value);
            me.store.filters.clear();
            }
        }
        }
    ]
    }
];

me.columns = me.getColumns();
me.callParent();
},

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试设置collapseDirection ..

来自文档:

collapseDirection : String
The direction to collapse the Panel when the toggle button is clicked.

Defaults to the headerPosition

Important: This config is ignored for collapsible Panels which are direct child items of a border layout.

Specify as 'top', 'bottom', 'left' or 'right'.

Available since: 4.0.0