1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    2
    Vote Rating
    0
    wzcyellow is on a distinguished road

      0  

    Exclamation Answered: How to get 'FormPanel.buttons' value

    Answered: How to get 'FormPanel.buttons' value


    I want to "this.formpanel.buttons" Get "button" object, but why not ask?
    Code:
    this.formpanel = Ext.create('Ext.form.Panel', {
                //title:this.title,
                frame:true,
                url: 'ContactUsPage.aspx',
                defaultType: 'textfield',
                defaults: { xtype: 'textfield', anchor: '98%' },
                buttons:[
                    { text: 'Save'},
                    {text:'Return'}
                ]
            });
    this.formpanel.buttons = null//Why not here, "buttons" property value?
    this.formpanel.form.buttons = typeof Object//Why get here "buttons" property value, and the value of type "Object"

  2. During a component's construction it is common to copy the entire config object onto the component. This can result in there being a lot of properties on the component that don't actually do anything. Under normal circumstances you can only rely on a property if it is documented as a public property.

    The buttons config option is initially copied across to the component but as it is not used post-config it is subsequently deleted. As it is not documented as a public property there is nothing wrong with this.

    I believe the buttons property you see on the underlying form is also a consequence of a config copying process and it doesn't actually have any significance to that form. Indeed its value appears to just be the configs for the buttons and not the buttons themselves.

    From reading the documentation:

    http://docs.sencha.com/ext-js/4-0/#!...el-cfg-buttons

    it seems that the buttons config option is just a shorthand for creating a docked toolbar. One way to access the buttons themselves might be to use component queries:

    Code:
    this.formpanel.getDockedItems('toolbar[dock=bottom]')[0].query('button');
    This will give you an array containing the two buttons. There are many variations on this theme.

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Answers
    540
    Vote Rating
    307
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    During a component's construction it is common to copy the entire config object onto the component. This can result in there being a lot of properties on the component that don't actually do anything. Under normal circumstances you can only rely on a property if it is documented as a public property.

    The buttons config option is initially copied across to the component but as it is not used post-config it is subsequently deleted. As it is not documented as a public property there is nothing wrong with this.

    I believe the buttons property you see on the underlying form is also a consequence of a config copying process and it doesn't actually have any significance to that form. Indeed its value appears to just be the configs for the buttons and not the buttons themselves.

    From reading the documentation:

    http://docs.sencha.com/ext-js/4-0/#!...el-cfg-buttons

    it seems that the buttons config option is just a shorthand for creating a docked toolbar. One way to access the buttons themselves might be to use component queries:

    Code:
    this.formpanel.getDockedItems('toolbar[dock=bottom]')[0].query('button');
    This will give you an array containing the two buttons. There are many variations on this theme.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."