Andrey Kon
Andrey Kon

Reputation: 1149

Extending Ext.data.reader.Json

What method do I have to override so as to extend Ext.data.reader.Json (for a TreeStore)? My new Reader must just take json object already parsed by base Reader class and rearrange several items in it. I just need to understand which Reader method is invoked by Proxy when Proxy wants to get parsed data.

Upvotes: 1

Views: 1799

Answers (1)

Evan Trimboli
Evan Trimboli

Reputation: 30082

getResponseData is where it gets the data from the response and puts it into an appropriate format for the reader. Here you could make transformations to the JSON and then just let the reader do it's thing.

readRecords is where it turns the JSON into models, so you could also modify that.

The absolute latest is in onProxyLoad in Ext.data.Store, where it gets the returned records from the response & calls the loadRecords method to populate the store.

If it were me I would make an effort to do the first method, since it's the easiest thing to override.

Upvotes: 4

Related Questions