1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    Paris
    Posts
    7
    Vote Rating
    0
    ferreol.robert is on a distinguished road

      0  

    Default Answered: Combobox use of afterBodyEl, afterLabelTextTpl

    Answered: Combobox use of afterBodyEl, afterLabelTextTpl


    Hi,


    I tried to used afterBodyEl, afterLabelTextTpl, etc. without success.


    I have save my attempt here http://jsfiddle.net/EFFMA/

    Has someone already used those properties with success ?

    Thanks

  2. Looking at the source, in order for afterBodyEl to be used you must have msgTarget = 'side':

    Code:
    var states = Ext.create('Ext.data.Store', {
        fields : ['abbr', 'name'],
        data   : [
            {"abbr" : "AL", "name" : "Alabama"},
            {"abbr" : "AK", "name" : "Alaska"},
            {"abbr" : "AZ", "name" : "Arizona"}
        ]
    });
    
    Ext.create('Ext.form.ComboBox', {
        fieldLabel        : 'Choose State',
        store             : states,
        queryMode         : 'local',
        displayField      : 'name',
        valueField        : 'abbr',
        afterBodyEl       : 'Test',
        msgTarget         : 'side',
        afterLabelTextTpl : 'Test 2',
        renderTo          : Ext.getBody()
    });
    Also the afterLabelTextTpl is also showing up in this simple test using 4.1.2

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Looking at the source, in order for afterBodyEl to be used you must have msgTarget = 'side':

    Code:
    var states = Ext.create('Ext.data.Store', {
        fields : ['abbr', 'name'],
        data   : [
            {"abbr" : "AL", "name" : "Alabama"},
            {"abbr" : "AK", "name" : "Alaska"},
            {"abbr" : "AZ", "name" : "Arizona"}
        ]
    });
    
    Ext.create('Ext.form.ComboBox', {
        fieldLabel        : 'Choose State',
        store             : states,
        queryMode         : 'local',
        displayField      : 'name',
        valueField        : 'abbr',
        afterBodyEl       : 'Test',
        msgTarget         : 'side',
        afterLabelTextTpl : 'Test 2',
        renderTo          : Ext.getBody()
    });
    Also the afterLabelTextTpl is also showing up in this simple test using 4.1.2
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha Premium Member bambam's Avatar
    Join Date
    Dec 2012
    Location
    Moscow
    Posts
    12
    Vote Rating
    0
    bambam is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Looking at the source, in order for afterBodyEl to be used you must have msgTarget = 'side'
    Sorry, but I can't understand how msgTarget = 'side' helps to use afterBodyEl config.

    If we'll go jsfiddle and run your example, we'll see afterLabelTextTpl is working, but not afterBodyEl.

    (Sorry if my English doesn't let me understand your explaining)

  5. #4
    Sencha Premium Member
    Join Date
    Apr 2013
    Posts
    55
    Vote Rating
    1
    extjs.mscit is on a distinguished road

      0  

    Default target 'side' never shows at side.

    target 'side' never shows at side.


    Thanks for help with example, but i want to display "*" next to combobox, but it appears under combobox not at side possision, but bottom position. I set width 100%, even no success.
    How to display on side??

    Thanks.