簡體   English   中英

如何根據條件設置可折疊面板內部的塌陷值?-EXTJS

[英]How can I set the value of collapsed inside a collapsible panel depending on a condition?-EXTJS

我有一個可折疊的面板:

$cls.superclass.constructor.call(this, Ext.apply({
        panel = new Ext.Panel({
            title: "Panel",
            collapsed: true,
            items: [
                this.section({
                    items: [
                        this.filter = new Ext.form.DisplayField({})
                    ]
                })
            ],

            collapsible: true,
        })
    });

    Ext.extend($cls, frame.mono.dialog.ObjectPanel, {

            afterRender: function(rule) {
                $cls.superclass.afterRender.apply(this, arguments);
                //depending on some condition I'm trying to change the value of collapsed to false
                //if (//some condition) {
                this.panel.collapsed = false;
                this.panel.doLayout(); // this is not working
            }

        }
    });

如何根據條件在可折疊面板中設置折疊值?

您可以使用toggleCollapse方法來實現您要執行的操作。 在prerender事件中執行此操作。

請參考以下小提琴-

https://fiddle.sencha.com/#view/editor&fiddle/2kvv

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM