PDA

View Full Version : ASP & JSonStore & Oracle



nicolasbkz
14 Aug 2009, 5:26 AM
Hi,

I Use some JSonStore in my application like these and they works.

var storeSI = new Ext.data.JsonStore({
id: 'storeSI',
url: 'JsonStoreSI.asp',
baseParams: { type: 'SI' },
fields: [ 'SI']
});
storeSI.load();
var storeAction = new Ext.data.JsonStore({
id: 'storeAction',
url: 'JsonStoreSI.asp',
baseParams: {type: 'Action', SI: ''},
fields: [ 'CODE_ACTION' ]
});
storeAction.load();
}Another JsonStore is defined by this code :

var storeDetailAction = new Ext.data.JsonStore({
id: 'storeDetailAction',
url: 'JsonStoreSI.asp',
baseParams: {type: 'DetailAction', SI: combo.lastSelectionText, Action: comboAction.lastSelectionText},
fields: [ 'SI', 'CODE_ACTION', 'CODE_PPS', 'LIBELLE_ACTION', 'CODE_STADE', 'DATE_STADE', 'DATE_FIN', 'DATE_FIN_REVISEE', 'DATE_DIFFUSION_PREVUE', 'DATE_DIFFUSION_REVISEE', 'DATE_CREATION', 'COMMENTAIRE_PPS', 'TYPE_ACTION', 'CODE_ACTION_PIA_GAUCHE', 'CODE_ACTION_PIA_DROIT'
, 'LIBELLE_ACTION_PIA', 'CHANTIER_SDSI', 'CODE_NATURE', 'LIBELLE_NATURE' ]
});
storeDetailAction.load();The response to the JSonStoreSI.asp looks like this :

[
{
"SI": "GALAXIE",
"CODE_ACTION": "DEMAN",
"CODE_PPS": "PRODUIT",
"LIBELLE_ACTION": "MAINTENANCE GALAXIE",
"CODE_STADE": "PERM",
"DATE_STADE": "01/01/01",
"DATE_FIN": "31/12/08",
"DATE_FIN_REVISEE": "01/01/01",
"DATE_DIFFUSION_PREVUE": "31/12/08",
"DATE_DIFFUSION_REVISEE": "01/01/01",
"DATE_CREATION": "06/03/08",
"COMMENTAIRE_PPS": "a",
"TYPE_ACTION": "Plan de charge",
"CODE_ACTION_PIA_GAUCHE": "1a09",
"CODE_ACTION_PIA_DROIT": "GALMCOOR",
"LIBELLE_ACTION_PIA": "MCO PERIMETRES EN PRODUCTION ET OPTIMISATIONS",
"CHANTIER_SDSI": "1a09",
"CODE_NATURE": "30",
"LIBELLE_NATURE": "MCO"
}
]but the storeDetailAction doesn't have any data... What am i missing ?

moegal
14 Aug 2009, 6:36 AM
for 1 your json should look more like:



( {"Records": [

{
"SI": "GALAXIE",
"CODE_ACTION": "DEMAN",
"CODE_PPS": "PRODUIT",
"LIBELLE_ACTION": "MAINTENANCE GALAXIE",
"CODE_STADE": "PERM",
"DATE_STADE": "01/01/01",
"DATE_FIN": "31/12/08",
"DATE_FIN_REVISEE": "01/01/01",
"DATE_DIFFUSION_PREVUE": "31/12/08",
"DATE_DIFFUSION_REVISEE": "01/01/01",
"DATE_CREATION": "06/03/08",
"COMMENTAIRE_PPS": "a",
"TYPE_ACTION": "Plan de charge",
"CODE_ACTION_PIA_GAUCHE": "1a09",
"CODE_ACTION_PIA_DROIT": "GALMCOOR",
"LIBELLE_ACTION_PIA": "MCO PERIMETRES EN PRODUCTION ET OPTIMISATIONS",
"CHANTIER_SDSI": "1a09",
"CODE_NATURE": "30",
"LIBELLE_NATURE": "MCO"
}

], "RecordCount":"1" } )


And you should probably have something like this in the store:



root: 'Records',
totalProperty: 'RecordCount',


Marty