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
|
var resultats_liste = new Ext.grid.GridPanel({stripeRows:true,stateful:true,columns:[{header:'Référence',width:120,sortable:true,dataIndex:'reference'},{header:'Rédaction',sortable:true,dataIndex:'redacteur'},{header:'Date',sortable:true,dataIndex:'dateredaction',width:70},{header:'Approbation',sortable:true,dataIndex:'approbateur'},{header:'Date',sortable:true,dataIndex:'dateapprobation',width:70},{header:'Objet',sortable:true,dataIndex:'objet',width:290}],ds:ds,height:500,sm: new Ext.grid.RowSelectionModel({singleSelect: true,listeners: {
rowselect: function(sm,index,record) {
tabpane.setActiveTab(1);
var id = record.data.reference;
Ext.Ajax.request({url:'php/exemple.php?id='+id,success:function(xhr)
{
var resultat = Ext.decode(xhr.responseText);
if(resultat!=-1)
{
//Ces 3 alertes affichent bien les dates
alert(resultat.dateredac);
alert(resultat.dateapplic);
alert(resultat.dateapprob);
Ext.getCmp('nte_reference').setValue(resultat.reference);
//Les dates affichées ici ne sont pas les mêmes que dans les alerts
Ext.getCmp('nte_dateredaction').setValue(resultat.dateredac);
Ext.getCmp('nte_dateapprobation').setValue(resultat.dateapprob);
Ext.getCmp('nte_dateapplication').setValue(resultat.dateapplic);
}
},failure:function(){Ext.Msg.alert('status','Erreur');}});
}
}})});
var dateredac_fld = new Ext.form.DateField({name:'nte_dateredaction',id:'nte_dateredaction',readOnly:true});
var dateapprob_fld = new Ext.form.DateField({name:'nte_dateapprobation',id:'nte_dateapprobation',readOnly:true});
var dateapplic_fdl = new Ext.form.DateField({name:'nte_dateapplication',id:'nte_dateapplication'}); |
Partager