1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| var promoStore = Ext.create('Ext.data.JsonStore', {
storeId: 'promos',
proxy: {
type: 'ajax',
url: 'country.php',
reader: {
type: 'json',
root: 'rows',
autoLoad: true
}
},
fields: [
'id_countri',
'nom_country'
]
});
var promosStore1 = Ext.create('Ext.data.JsonStore', {
storeId: 'promos',
proxy: {
type: 'ajax',
url: 'region.php',
reader: {
type: 'json',
root: 'rows',
}
},
fields: [
'id_region',
'nom_region'
]
});
//Créez maintenant la liste déroulante qui utilise le magasin précédent comme source pour son contenu :
var promosCombo = Ext.create('Ext.form.ComboBox', {
id: 'promosCombo',
fieldLabel: 'Arrondissement',
triggerAction: 'all',
emptyText: 'Choisir une arrondissement',
editable: false,
store: promosStore,
mode: 'local',
valueField: 'nom_country',
displayField: 'id_country',
renderTo: Ext.getBody(),
});
var promosCombo1 = Ext.create('Ext.form.ComboBox', {
id: 'promosCombo1',
fieldLabel: 'Fokontany',
triggerAction: 'all',
emptyText: 'Choisir un fokontany',
editable: false,
store: promosStore1,
mode: 'local',
valueField: 'nom_region',
displayField: 'id_region',
renderTo: Ext.getBody()
});
var promosSelectionForm = Ext.create('Ext.form.Panel', {
id: 'promosSelection',
frame: true,
width: '100%',
buttonAlign: 'center',
labelAlign: 'left',
labelWidth: 70,
items: [
promosCombo,
promosCombo1
],
buttons: [
submitButton
],
renderTo: Ext.getBody()
}); |
Partager