View Full Version : triggerAction and combo boxes...

18 Mar 2011, 12:07 PM

I've had some issues with populating combo boxes using MVC 2 & 3 and EXT, but I've noticed that adding the line "triggerAction: 'all'" seems to fix it. None of the tutorials or books I've found mention this (but I'm sure I haven't found all of them). I just grabbed an example from a recently released book that does not have "triggerAction" in it anywhere - it's not even listed in the index - but it contains a remote combo box that didn't work for me until I added the triggerAction line. The API docs obviously mention triggerAction and the ComboBox sample also includes it, but why do other examples seem to overlook this? Am I missing something? I'm just curious in case I run into similar instances when using EXT.

The code below worked in VS 2010 using MVC 3 and EXT 3.3.2:

var genres = new Ext.data.Store({
reader: new Ext.data.JsonReader({ root: "rows", totalProperty: "count", fields: ["ID", "Name"] }),
proxy: new Ext.data.HttpProxy({
api: { read: { method: "GET", url: "/GUIStuff/Clients"}} }),
autoLoad: true

var movie_form = new Ext.FormPanel({
renderTo: Ext.getBody(),
frame: true,
title: 'What an awesome panel',
width: 250,
items: [
xtype: 'combo',
hiddenName: 'name',
fieldLabel: 'Genre',
mode: 'remote',
store: genres,
displayField: 'Name',
valueField: 'ID',
width: 120,
triggerAction: 'all'