examples/form/dynamic.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 11 Aug 2010 06:19:25 +0000 (14:19 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 11 Aug 2010 06:19:25 +0000 (14:19 +0800)
examples/form/dynamic.js

index 98f573a..8532899 100644 (file)
@@ -318,7 +318,33 @@ Roo.onReady(function(){
                 name:'textex',
                 fieldLabel: 'Simple',
                 value : 'example text'
+            } ,
+
+        new Roo.form.{
+            xtype: 'ComboBox',
+            xns : Roo.form,
+            fieldLabel: 'State',
+            hiddenName:'state',
+            store: {
+                xtype: 'SimpleStore',
+                xns : Roo.data,
+                fields: ['abbr', 'state'],
+                data : Roo.exampledata.states // from states.js
+            },
+            displayField:'state',
+            typeAhead: true,
+            mode: 'local',
+            triggerAction: 'all',
+            emptyText:'Select a state...',
+            selectOnFocus:true,
+            width:190,
+            listeners : {
+                add : function()
+                {
+                    Roo.messageBox.alert("Alert", "Add Pressed");
+                }
             }
+        }),
         
         ]
     });