Loading a json config into a Form

I have an external .json-file with a valid form configuration.
How do I load this file into a form? Is it possible?
The form works if the json is embeddid in the .js-file.

In version 5 you could do something like this:

gAttestActionForm = winAttestAction.attachForm();

Is this still possible? Putting the whole JSON definition in the js file is not very pretty.

You may use the AJAX to load your configuration from the external file.


dhx.ajax.get(url).then(function (data) {
const form = new dhx.Form("form", data)