Extjs 4 How to get id of parent Component?

后端 未结 2 695
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 01:23

I have multiple fieldset. And have Button inside each fieldset in Extjs 4. I want to get fieldset id on the button click event, so that i can know from which fieldse

2条回答
  •  情话喂你
    2021-01-05 01:30

    I've implemented handler properly.

    {
        xtype:'fieldset',
        id:'fs1',
        items:[{
            xtype:'button',
            id:'b1',
            handler:function(btn){
                // Retrieve fieldset. 
                var fieldset = btn.up('fieldset');
                // Retrieve Id of fieldset.
                var fieldsetId = fieldset.getId();
            }
        }]
    }
    

    In that case try this:

    button.up("[xtype='fieldset']")
    

提交回复
热议问题