Laith Harzalli
Laith Harzalli

Reputation: 9

json problem after including the new Extjs version 6.7

I want to upgrade the version of extjs from 6.5 to 6.7. in my application, after including the extjs 6.7 files and building the solution i get this error: Ext.JSON.decode(): You 're trying to decode an invalid JSON String. Any solution please?

Upvotes: 1

Views: 452

Answers (1)

zeke
zeke

Reputation: 3663

I assume this is the same problem I had when upgrading from 6.5. I think in version 6.6 they changed the structure of the response objects for store callbacks and instead of providing a responseText property that needed to be decoded into JSON, they provide a responseJson property that is already decoded.

So as a result, my code that had previously looked like this:

callback: function (records, request) {
    var response = Ext.decode(request.getResponse().responseText);
}

had to be changed to this:

callback: function (records, request) {
    var response = request.getResponse().responseJson;
}

I'm guessing you will have to do something similar to fix your issues.

Upvotes: 1

Related Questions