Jump to content

How can I add column to DBLookUpComboBox


Freeman35

Recommended Posts

Hello,

I'm trying multi colum DBLookUpComboBox. Its code example on this link and my modified code is

https://docs.sencha.com/extjs/6.2.0/classic/Ext.form.field.ComboBox.html

col2 is my add colum.

tpl example from here

https://www.sencha.com/forum/showthread.php?7749-Adding-a-MultiColumn-ComboBox&s=94883ddfe5b974125a16f9381b4a44cf&p=49188&viewfull=1#post49188
 

var states = Ext.create('Ext.data.Store', {
    fields: ['abbr', 'name', 'col2'],
    data : [
        {"abbr":"AL", "name":"Alabama", "col2":"AAA"},
        {"abbr":"AK", "name":"Alaska" , "col2":"BBBB"},
        {"abbr":"AZ", "name":"Arizona", "col2":"CCCC"}
    ]
});

Ext.create('Ext.form.ComboBox', {
    fieldLabel: 'Choose State',
    store: states,
    queryMode: 'local',
    valueField: 'abbr',
    renderTo: Ext.getBody(),
    // Template for the dropdown menu.
    // Note the use of the "x-list-plain" and "x-boundlist-item" class,
    // this is required to make the items selectable.
    tpl: Ext.create('Ext.XTemplate',
        '<ul class="x-list-plain"><tpl for=".">',
            //'<li role="option" class="x-boundlist-item">{abbr} - {name}</li>',
            '<li role="option" class="x-boundlist-item"><div class="x-combo-list-item"><div style="position: absolute;left: 0;">{name}</div><div style="position: relative;left: 150;">{col2}</div></div>',
        '</tpl></ul>'
    ),
    // template for the content inside text field
    displayTpl: Ext.create('Ext.XTemplate',
        '<tpl for=".">',
            '{name} - {col2}',
        '</tpl>'
    )
});

 

I need add colum or colums in combobox. extjs can do this since sencha 3 (follow my links)

I can set css or style via tpl. But I could'nt, I hope yet. I need help for,

1-) How to add extra field(s) and data's(s)

2-) How to set tpl (if I'm not wrog this mean row style)

Thank you.

Link to comment
Share on other sites

Hi,

this is on my request features list from years... :-)
Non only multi column, but with an entire DBgrid in popup...

And with assisted input on value found (suggestion on first value found while typing, and with no entry on nonfound values.... for true consistent input value)

 

Link to comment
Share on other sites

  • 11 months later...
  • 10 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...