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
| Ext.define('KitchenSink.store.dstore_Recherche_Numero_Presc', {
model: Ext.define('KitchenSink.model.dstore_Recherche_Numero_Presc', {
extend: 'Ext.data.Model',
autoDestroy: true,
proxy: {
type: 'ajax',
url: 'Recherche_Numero_Prescription.php',
reader: {
type: 'json',
root: 'data',
idProperty: 'id',
totalProperty: 'total'
}
},
pageSize: 50,
fields: ['Nom','Prenoms','numero']
}),
storeId: 'dstore_Recherche_Numero_Presc'
});
function Rechercher() {
var _Numero_police = Ext.getCmp('_Numero_police');
var _Numero_adherent = Ext.getCmp('_Numero_adherent');
var _Numero_affilie = Ext.getCmp('_Numero_affilie');
dstore_Recherche_Numero_Presc.load({ // Erreur à ce niveau ; dstore_Recherche_Numero_Presc is not defined
params:{
start: 0,
limit: 1,
numero_police: _Numero_police,
numero_adherent: _Numero_adherent,
numero_affilie: _Numero_affilie
},
// scope: this,
callback:function(records, operation, success) {
if (success) {
alert('oui');
var numbRows = dstore_Recherche_Numero_Presc.getCount();
var compteur = 0;
for(compteur = 0; compteur < numbRows; compteur++){
var lrec_recherche = dstore_Recherche_Numero_Presc.getAt(compteur);
if (lrec_recherche) {
alert(lrec_recherche.get('numero_prescription'));
_Numero_prescription.value=lrec_recherche.get('numero_prescription');
}
}
if(numbRows == 0) // si rien n'est retourné
{
_Num_prescription.value=' ';
alert('Il y a pas de prise ');
}
}
else {
alert('Une erreur est survenue!!!');
}
} // Fin fonction callback
});
}; |
Partager