View Full Version : ListView inside ComboBox

20 Jul 2010, 2:57 AM

I can't figure out how to alter the list view inside a combobox. There's the property 'view' but I can't seem to alter that. I'm trying to show a grid of data inside a combobox. I have a store, a listview and a combobox but how do I put them all together?

20 Jul 2010, 3:05 AM
The only way is to override the initList method of the ComboBox.

20 Jul 2010, 3:11 AM
When you say grid of data, you don't mean a full GridPanel, but just tabular data display?

You can do that by using http://www.sencha.com/deploy/dev/docs/?class=Ext.form.ComboBox&member=tpl

Give it a template which outputs a table decorated with appropriate class names, set up some CSS rules to style them, and job's a good 'un.

20 Jul 2010, 4:07 AM
Thanks, using a template seems to be the easiest way to do this, although quite a lot of markup to achieve the grid look. I was hoping you could just assign a ListView to the ComboBox and it would just use that.

20 Jul 2010, 4:13 AM
Not that much. You have to define a table and tbody, then within the <tpl for="."> a tr and tds for each field that you want displayed.

Pretty normal for displaying data in an HTML page.