Results 1 to 2 of 2

Thread: need to load store with selected value from combo

  1. #1

    Default need to load store with selected value from combo

    Hi all,
    im making some kind of form for an application using the wizard extension.
    Now in step 3 i want to load a combo with values based on the country selection in step 2

    so in step 3 i need to access the selected value in step 2 and use it in step 3 to load according supplier info within that country
    Im trying to load a store based on a selected value .

    Code:
    var
    Wizzard_supplierstore =new Ext.data.JsonStore({
    url
    :'json_suppliers_combo2.php',
    autoLoad
    :false,
    fields
    :[{
    name
    :'PID'
    },{
    name
    :'PNAME',
    type
    :'string'
    }]
    });
    // code new
    Ext.ux.Wiz.Card({
    id
    :'country',
    title
    :'Country',
    monitorValid
    :true,
    defaults
    :{
    labelStyle
    :'font-size:11px'
    },
    items
    :[{
    border
    :false,
    bodyStyle
    :'background:none;padding-bottom:30px;',
    html
    :'Please select the country where u want to add the RATE for.'
    },{
    xtype
    :'combo',
    name
    :'prov_country',
    id
    :'prov_country',
    listeners
    :{
    // 'change' will be fired when the value has changed and the user exits the ComboBox via tab, click, etc.
    // The 'newValue' and 'oldValue' params will be from the field specified in the 'valueField' config above.
    select
    :function(combo, newValue, oldValue){
    region
    = Ext.getCmp('name_supplier');
    region
    .clearValue();
    Wizzard_supplierstore
    .reload({
    params
    :{
    cid
    : combo.getValue()
    }
    });
    }
    },
    store
    :new Ext.data.JsonStore({
    url
    :'json_countries.php',
    // fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
    // fields: ['ID', 'NAME', 'CODE'],
    autoLoad
    :false,
    fields
    :[{
    name
    :'ID'
    },{
    name
    :'NAME',
    type
    :'string'
    }]
    }),
    fieldLabel
    :'Country',
    displayField
    :'NAME',
    valueField
    :'ID',
    hiddenName
    :'ID',
    allowBlank
    :false,
    typeAhead
    :false,
    mode
    :'remote',
    triggerAction
    :'all',
    emptyText
    :'Select a country...',
    selectOnFocus
    :true,
    anchor
    :'90%'
    }]
    }),new Ext.ux.Wiz.Card({
    title
    :'Supplier',
    monitorValid
    :true,
    defaults
    :{
    labelStyle
    :'font-size:11px'
    },
    items
    :[{
    border
    :false,
    bodyStyle
    :'background:none;padding-bottom:30px;',
    html
    :'Please select the supplier within the selected country where u want to add the number for.'
    },{
    xtype
    :'combo',
    id
    :'name_supplier',
    name
    :'name_supplier',
    store
    : Wizzard_supplierstore,
    fieldLabel
    :'Supplier',
    displayField
    :'PNAME',
    valueField
    :'PID',
    hiddenName
    :'PID',
    allowBlank
    :false,
    autoload
    :true,
    typeAhead
    :true,
    mode
    :'local',
    lastQuery
    :'',
    triggerAction
    :'all',
    emptyText
    :'Select a supplier...',
    selectOnFocus
    :true,
    anchor
    :'90%'
    }]
    }),
    Any help would be appreciated

  2. #2

Posting Permissions

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