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
|
var comboSites;
var comboEntreprises;
var dataSites ;
var dataEntreprises;
Ext.onReady(function(){
dataEntreprises = new Ext.data.JsonStore
({
url: 'http://192.168.4.214/www/Cartes/fonctions.php?action=getEntreprises',
fields: ['nom']
});
dataEntreprises.load();
dataSites = new Ext.data.JsonStore
({
url: 'http://192.168.4.214/www/Cartes/fonctions.php?action=getSites',
fields: ['site','nom']
});
dataSites.load();
comboSites = new Ext.form.ComboBox
({
store: dataSites,
displayField:'site',
valueField:'site',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Selectionner un site ...',
selectOnFocus:true,
selectOnFocus : true,
applyTo: 'sites'
});
comboEntreprises = new Ext.form.ComboBox
({
store: dataEntreprises,
displayField:'nom',
valueField:'nom',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Selectionner une entreprise ...',
selectOnFocus : true,
listeners:{
select:{
fn:function()
{
comboSites.clearValue();
comboSites.store.filter('nom', comboEntreprises.getValue());
}
}
},
lastQuery:'',
applyTo: 'entreprises'
});
}); |
Partager