Skip to main content

DataProxy overview

DataProxy is a helper that enables communication with external data sources. Using the helper allows creating a custom URL and assigning it to a variable that considerably simplifies work with server-side backend.

const proxy = new dhx.DataProxy("someUrl", {
// config options
})

The dhx.DataProxy helper takes two parameters:

  • url - (string) ordinary, the external URL
  • params - (object) optional, a set of custom parameters to be sent to the server with a request

For example, you can apply it either to DataCollection:

const dataCollection = new dhx.DataCollection();
const proxy = new dhx.DataProxy("https://myCustomUrl.com");
dataCollection.load(proxy);

or to any component of the dhtmlxSuite library that operate with data:

const grid = new dhx.Grid(...);
const proxy = new dhx.DataProxy("https://myCustomUrl.com");
grid.data.load(proxy);

The list of the available methods of dhx.DataProxy is described below.

Methods

NameDescription
load()loads data from an external URL
save()sends an AJAX request to the server
updateUrl()updates the initial URL and parameters that were specified when initializing proxy