I've opened a FR here https://github.com/bryntum/support/issues/11735
Testing your code, will be back shortly
Support Forum
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
HI Vadim,
Also based on the documentation it seems that it should respect and pass the request response, and not the parsedJSON
We do not support not JSON data format right now. AjaxHelper.get returns an object response, it is hardcoded now. We read parsedJson property from that method, it contains JavaScript Object - parsed JSON. In this case this is just a response, parsed into JS object.
fetch(url, options).then(
response => {
if (options.parseJson) {
response.json().then(json => {
response.parsedJson = json;
resolve(response);
}).catch(error => {
response.parsedJson = null;
response.error = error;
reject(response);
});
}
else {
resolve(response);
}
}
).catch(error => {
error.stack = promise.stack;
reject(error);
});
AjaxHelper.get calls AjaxHelper.fetch and base fetch after some preparation and set parsedJson property, the name is hardcoded now.
Obviously, we need to implement support of another readers. It has not been requested so far.
Regarding to your overrides. Easiest way would be to override static AjaxHelper.fetch and implement your own logic for fetch and parse response globally.
Pseudo code
class AjaxHelperOverride {
static get target() {
return {
class : AjaxHelper,
product : 'grid',
minVersion : '1.0',
maxVersion : '7.0'
}
}
static fetch(url, options) {
// here your code
}
}
Override.apply(AjaxHelperOverride);
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
class AjaxHelperOverride {
static get target() {
return {
class: AjaxHelper,
product: 'grid',
minVersion: '1.0',
maxVersion: '7.0',
};
}
static fetch(url, options) {
if (options.fetch) {
return options.fetch(url, options);
} else {
return this._overridden.fetch.call(this, url, options);
}
}
}
with the custom fetchOptions.fetch above makes the workaround, of course we wait for the OOTB solution, thanks.
Thank you for letting us know!
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy