Request new features or modifications


Post by alex.l »

I've opened a FR here https://github.com/bryntum/support/issues/11735
Testing your code, will be back shortly

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy


Post by vadim_g »

Also based on the documentation it seems that it should respect and pass the request response, and not the parsedJSON.

Anyway, thanks for the FR open, hope to see it soon in the next builds.

Screenshot 2025-08-05 at 12.29.15.png
Screenshot 2025-08-05 at 12.29.15.png (214.46 KiB) Viewed 17458 times

Post by alex.l »

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


Post by vadim_g »

Yes, that's what I understood from reading the code, hence my request for a FR.
Ok, thanks for the override idea.


Post by vadim_g »

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.


Post by alex.l »

Thank you for letting us know!

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy


Post Reply