Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: combobox template

  1. #1

    Default combobox template

    how to configure combobox to wortk with XTemplate? What i mean: i have to do my combo items with tax sign (%). I tried to do sth like:

    PHP Code:
    Ext.form.ComboBox({
    ..
    tpl: new Ext.XTemplate(
        
    '<tpl for="."><div class="x-combo-list-item">{MyDisplayField} %</div></tpl>'
        
    ),
    .. 

  2. #2

    Default

    you may try to use Ext.ux.data.CalcRecord for the store in the combobox.
    http://extjs.com/forum/showthread.php?t=28826

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    What's this? Are you asking for help or what?

  4. #4

    Default

    i'm asking for help 'cos it doesn't work

  5. #5

    Default

    I think that he wants to use renderer to add a suffix '%' to the displayField. However, only ColumnModel of grid have it.

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    "Doesn't work" doesn't help.

    So, your Record contains a data property called MyDisplayField does it?

    Is the "%" showing up?

  7. #7

    Default

    in my combo shows up only DisplayField here is my combo code

    PHP Code:
    combobox.taxComboBox Ext.extend(Ext.form.ComboBox, {
        
    fieldLabel:     'TAX',
        
    mode:             'local',
        
    name:             'TAX_TXT',
        
    hiddenValue:    'TXT',
        
    valueField:        'TAX_TXT',
        
    displayField:    'TAX_TXT',
        
    triggerAction:     'all',
        
    editablefalse,
        
    store: new Ext.data.Store({
            
    autoLoadtrue,
            
    proxy: new Ext.data.HttpProxy({
                
    urlthis.url,
                
    timeout100000,
                
    method'post'
            
    }),
            
    reader: new Ext.data.JsonReader({
                
    rootnull
            
    },[
                {
    name:'TAX_TXT'mapping:'TAX_TXT'},
                {
    name:'TAX'mapping:'TAX'}
            ])
        }),
        
    selectOnFocustrue,
        
    forceSelectiontrue,
        
    tpl: new Ext.XTemplate(
        
    '<tpl for="."><div class="search-item">{TAX_TXT}%</div></tpl>'
        
    ),
        
    itemSelector'div.search-item',
        
    autoScrolltrue,
        
    overflow'auto',
        
    lastQuery:'',
        
    emptyText'Choose tax...'
    }); 

  8. #8
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    mode: 'local'? But you specify a URL? Is it making that request?

  9. #9

    Default

    url is specify as var url = file.php?action='get_tax_form_db'
    it is load at the beginning of the app. So when i render the combo data is loaded

  10. #10
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Mode local means no Ajax. Debug it. Is the Store loaded?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •