Results 1 to 2 of 2

Thread: EASY answer, I hope

  1. #1

    Default EASY answer, I hope

    I'm getting an empty combobox. Why?

    PHP Code:
      fieldLabel'State',
      
    hiddenName'state',
      
    xtype"combo",
         
    store: new Ext.data.SimpleStore({
             
    fields: ["abbreviation"],
             
    data'templates/'+strAdminTemplate+'/build_us_states.php'
             
    //data above returns: [['AK'],['AL'], ... ,['WY']]
         
    }),
         
    allowBlankfalse,
         
    displayField"abbreviation",
         
    valueField"abbreviation",
         
    limitToListtrue,
         
    forceSelectiontrue,
         
    mode"local",
         
    triggerAction"all",
         
    emptyText"Select when...",
         
    selectOnFocustrue,
         
    resizablefalse,
         
    width50 

  2. #2

    Default Almost there ...

    Almost figured it out myself. Figuring out some of this stuff is like putting together a car in pitch black. Sure, all of the peices are there...

    JSON from build_us_states.php (referenced in the code below):
    PHP Code:
    {'totalCount':'3',
    'States':[
         {
    'idstate''2''abbreviation''AK'},
         {
    'idstate''1''abbreviation''AL'},
         {
    'idstate''4''abbreviation''AR'}
    ]} 
    Ext:
    PHP Code:
      fieldLabel'State',
      
    hiddenName'state',
      
    xtype'combo',
         
    store: new Ext.data.Store({
             
    proxy: new Ext.data.HttpProxy({url'templates/'+strAdminTemplate+'/build_us_states.php'}),
             
    reader: new Ext.data.JsonReader({
                 
    id'idstate',
                 
    totalProperty'totalCount',
                 
    root'States'
             
    }, [{
                 
    name'idstate'
             
    }, {
                 
    name'abbreviation'
             
    }])
         }),
         
    allowBlankfalse,
         
    displayField"abbreviation",
         
    valueField"abbreviation",
         
    limitToListtrue,
         
    forceSelectionfalse,
         
    mode"remote",
         
    autoLoadtrue,
         
    triggerAction"all",
         
    emptyText"Select when...",
         
    selectOnFocustrue,
         
    editabletrue,
         
    resizablefalse,
         
    width50 
    This works except that I want to type in a two-state abbrieviation into the combobox, and have it select the correct one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •