The grid methods and events
When creating a DHTMLX grid, we first create the object; second we add all the settings and then call a method to initialize it. After the grid is initialized data can then be added.
The order of steps to create a grid is as follows:
Create the grid object
Apply settings
Initialize
Add data
Now we will go over initializing a grid.
Initialization choices
We can initialize a DHTMLX grid in two ways, similar to the other DHTMLX objects. The first way is to attach it to a DOM element and the second way is to attach it to an existing DHTMLX layout cell or layout.
Note
A grid can be constructed by either passing in a JavaScript object with all the settings or built through individual methods.
Initialization on a DOM element
Let's attach the grid to a DOM element. First we must clear the page and add a div element using JavaScript.
Type and run the following code line in the developer tools console:
document.body.innerHTML = "<div id='myGridCont'></div>";
We just cleared...