JavaScript DataSource Binding to Local Data

To bind Shield UI DataSource to local data, provide the data initialization option when creating a new DataSource instance. The data setting must be a JavaScript array or an object containing the data in a nested property:

var ds = new shield.DataSource({
	data: [/*...*/]
});

ds.read().then(function () {
	var dataView = ds.view;
	//dataView contains the local data
});

Alternatively, if the local data is a JavaScript array and there are no additional initialization options, you can provide the data array directly as a first constructor argument:

var myDataArray = [/*...*/];
var ds = new shield.DataSource(myDataArray);
ds.read().then(function () {
	var dataView = ds.view;
	//...
});

Once the DataSource is initialized, the local array is accessible through the data property of the DataSource.