
February 15th, 2013, 10:20 AM
|
|
Contributing User
|
|
Join Date: Jun 2009
Posts: 295
  
Time spent in forums: 3 Days 8 h 37 m 29 sec
Reputation Power: 5
|
|
|
Help building a Drop-down
Howdy y'all. My goal is to offer a drop-down to select "Personal, Cell, Business", but if someone wishes to have something other than our common 3 options, I wish them to be able to type their answer in the drop-down. The drop-down I found at http://dev.sencha.com/deploy/ext-4....orm/combos.html seems to do just that, but iunno how to complete their script as needed. It currently doesn't show on page, n I'm thinking maybe because I haven't edited the script and inserted my 3 options into its store. Sorry, I'm not really a JS guru, but sometimes what customers want, you gotta figure out.
The example provided by the site was in reference to states, but mine is a drop-down in reference to phone number type.
Code:
<script src="modules/rolodex/combo.js"></script>
// Define the model for a State
Ext.regModel('State', {
fields: [
{type: 'string', name: 'abbr'},
{type: 'string', name: 'name'},
{type: 'string', name: 'slogan'}
]
});
// The data store holding the states
var store = Ext.create('Ext.data.Store', {
model: 'State',
data: states
});
// Simple ComboBox using the data store
var simpleCombo = Ext.create('Ext.form.field.ComboBox', {
fieldLabel: 'Select a single state',
renderTo: 'simpleCombo',
displayField: 'name',
width: 500,
labelWidth: 130,
store: store,
queryMode: 'local',
typeAhead: true
});
Last edited by Triple_Nothing : February 15th, 2013 at 10:22 AM.
|