Ich habe einige Probleme, dies zu debuggen und eine Lösung zu bekommen.ExtJS - Fehlerzustände 'ProtoType' ist null oder kein Objekt
Meine Daten werden korrekt an mich zurückgesendet, aber es wirft den TypeError auf mich, wenn ich einen Unterbrechungspunkt auf die "Loadexception" -Funktion setze. Hier ist der Fehler:
Beschreibung - „‚Prototyp‘ist Null oder kein Objekt“ Nachricht - „‚Prototyp‘ist Null oder kein Objekt“ Namen - „Typeerror“ Nummer - -2146823281
Also, obwohl meine Daten wieder richtig sind, wird mein Callbox-Meldungsfeld immer auf den Fehler geworfen.
V2020.dsPricing = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
method: 'POST',
url: url,
headers: {"Content-Type": "application/json; charset=utf-8"},
jsonData: Ext.util.JSON.encode({ serviceId: objPricingReturn.serviceId })
}),
reader: PricingJsonReader()
});
V2020.dsPricing.on('loadexception', function(obj, options, response, err) {
Ext.MessageBox.show({
title: 'Error',
msg: url + ' POST method fail...ErrorCode:' + response.status,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
});
V2020.dsPricing.load({
callback: function(records, o, s) {
if (!s) Ext.MessageBox.show({
title: 'Error',
msg: ' Failed to load pricing data',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
});
Hier ist der JsonReader Code
function PricingJsonReader() {
var pricingReaderObject = new Ext.data.JsonReader({
root: 'GetServicePriceByIdResult.ServicePricing',
fields: [{
name: 'priceId',
type: 'int'
},
{
name: 'serviceId',
type: 'int'
},
{
name: 'price',
type: 'float'
},
{
name: 'startDate',
type: 'date',
dateFormat: 'n/j/Y'
},
{
name: 'endDate',
type: 'date',
dateFormat: 'n/j/Y'
},
{
name: 'updatedBy',
type: 'string'
},
{
name: 'updateDate',
type: 'date',
dateFormat: 'n/j/Y'
}]
})
return pricingReaderObject;
}
Die Antwort (Ich denke, das ist das, was Sie fordern)
{"GetServicePriceByIdResult":{"ServicePricing":[{"priceId":14,"serviceId":1,"price":70.0000,"startDate":"6\/14\/2010 12:00:00 AM","endDate":"12\/31\/2011 12:00:00 AM","updatedBy":null,"updateDate":null},{"priceId":142,"serviceId":1,"price":70.0000,"startDate":"6\/14\/2010 12:00:00 AM","endDate":"12\/31\/2011 12:00:00 AM","updatedBy":null,"updateDate":null}]}}
Ehrfürchtig . Danke für die Abklärung. Ich wusste nicht, dass es selbst einen Leser schafft. – PixelMuse