views:

409

answers:

1

Is there are any libraries to make ComboBox to select multiline options when expanded. I am looking something similar to Combobox in ExtJS except values have to appear when user clicks down arrow, like in normal dropdown.

Does someone know if its possible to do something like that with ExtJS? Because their own community and support sure doesn’t (http://www.extjs.com/forum/showthread.php?t=94079)

+1  A: 

You can use the template config (tpl) to define how you want the dropdown list to look visually (which is exactly what the following code does in the example that you linked to from your forum post):

var resultTpl = new Ext.XTemplate(
    '<tpl for="."><div class="search-item">',
        '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',
        '{excerpt}',
    '</div></tpl>'
);
....
tpl: resultTpl

You can configure a standard combo box however you want (with or without a dropdown button -- that example uses hideTrigger:true to hide it). Sounds like you would also want triggerAction: 'all' so that the entire list is shown when you click the dropdown button.

Basically, just make sure you look at the ComboBox API docs to see what all is available -- what you want is perfectly standard behavior.

bmoeskau
That worked. It’s just I am new in ExtJS therefore even simple stuff like that were challenging one week ago. Thank you.
Vladimir Kuzin
I'm glad it worked. FYI - it's customary to "accept" the answer that best helped you so that everyone know it is the solution (and also I get some reputation points). Thanks!
bmoeskau