1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
    shin0135 is on a distinguished road

      0  

    Default Combobox list generated via tpl doesn't highlight the first item

    Combobox list generated via tpl doesn't highlight the first item


    Hi,

    For some reason, the combobox generated with xtemplate tpl doesn't highlight the first item automatically. I think that's the default behavior. Isn't it? Is there a way to programmatically highlight and select the first item by default so that when a user uses the enter key it gets selected as mouse click on the first item?

    Another question related is how to detect the tpl is rendered completely. Is there an event I could listen on?

    The combobox has the typeAhead attribute false and selectOnFocus true.
    Here is how the xtemplate looks like

    Code:
            var addressTpl = new Ext.XTemplate(
                '<tpl for=".">',
                    '<div class="x-combo-list-item" style="border-bottom: 1px solid #BDCEE4;">',
                        '<table width="100%" cellpadding="0" cellspacing="0">',
                            '<tr>',
                                '<td><b>{name}</b></td>',
                            '</tr>',
                            '<tr>',
                                '<td>{[this.formatAddress(values)]}</td>',
                            '</tr>',
                        '</table>',                
                    '</div>',            
                '</tpl>',
                { formatAddress: function(rec) {.....}};
    By the way, I'm using ExtJS 3.2 and currently there is no plan to upgrade to any other versions.

    Thanks!

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
    shin0135 is on a distinguished road

      0  

    Default


    Another question related is how to detect the tpl is rendered completely. Is there an event I could listen on?
    Does anyone have a solution for this? Specifically, I'd like to know a way of finding out when the combo box is expanded with data generated in xtemplate.

    Well, my main goal is to select/focus the first item on the list generated via tpl after the list is rendered and expanded.

Tags for this Thread