开发者

Multiline values in dropdown (ComboBox)

开发者 https://www.devze.com 2022-12-22 23:25 出处:网络
Is the开发者_JS百科re are any libraries to make ComboBox to select multiline options when expanded. I am looking something similar to Combobox in ExtJSexcept values have to appear when user clicks dow

Is the开发者_JS百科re 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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号