I want to render data to Grid.JS initially and then my page may grab additional data and add additional rows or fill in data that was missing in some of the rows. I'm not sure what the syntax is to write to the Grid.JS once you have rendered it once. My thought is that I have to rerender the entire table which is what I am attempting below but getting an error.
I tried this:
new gridjs.Grid({
columns: ["Name", "Email", "Phone Number"],
data: [["Mark", "mark@gmail.com", "(01) 22 888 4444"],["Eoin", "eoin@gmail.com", "0097 22 654 00033"],["Sarah", "sarahcdd@gmail.com", "+322 876 1233"],["Afshin", "afshin@mail.com", "(353) 22 87 8356"]]}).render(document.getElementById("gridjs"));
new gridjs.Grid({
columns: ["Test", "Email", "Phone Number"],
data: [["test", "test@example.com", "(353) 01 222 3333"],["Mark", "mark@gmail.com", "(01) 22 888 4444"],["Eoin", "eoin@gmail.com", "0097 22 654 00033"],["Sarah", "sarahcdd@gmail.com", "+322 876 1233"],["Afshin", "afshin@mail.com", "(353) 22 87 8356"]]}).render(document.getElementById("gridjs"));
When I attempt this I get the following error in the console:
[Grid.js] [ERROR]: The container element [object HTMLDivElement] is not empty. Make sure the container is empty and call render() again