From bdee0af3eaa9a15c816e2a286dfbb12e1695685c Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 6 Feb 2020 14:53:54 +0800 Subject: [PATCH] examples/form/nestedcombo.js --- examples/form/nestedcombo.js | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/examples/form/nestedcombo.js b/examples/form/nestedcombo.js index e69de29bb2..946a6a6ae8 100644 --- a/examples/form/nestedcombo.js +++ b/examples/form/nestedcombo.js @@ -0,0 +1,72 @@ +/* + * + * (C) Alan Knowles 2011 + * Licence : Roojs - LGPL + */ + +var mform; +var combo +Roo.onReady(function(){ + + Roo.QuickTips.init(); + + + /* + * ================ Form 2 ======================= + */ + mform = Roo.factory({ + xns : Roo.form, + xtype : 'Form', + labelAlign: 'top', + items : [ + { + xtype : 'ComboNested', + xns: Roo.form, + + fieldLabel: 'State', + + name : 'states_list', + hiddenName:'states', + + + valueField : 'abbr', + displayField:'state', + + + store: { + xns : Roo.data, + xtype : 'SimpleStore', + fields: ['abbr', 'state'], + data : Roo.exampledata.states // from states.js + + }, + + typeAhead: true, + mode: 'local', + triggerAction: 'all', + emptyText:'Select a state...', + selectOnFocus:true, + width:190, + listeners : { + change: function() { + Roo.log("changed to " + this.getValue()); + + } + } + } + + + ] + + }); + + mform.render('form-ct5'); + combo = mform.findField('states'); + mform.setValues({ + states : '["AK","AZ"]', + states_list : "Alaska, Arizona" + + }) + + +}); \ No newline at end of file -- 2.39.2