'How to add Azure SQL server to Grid.js table data attribute

I've been struggling for a couple of days trying to link my Grid.js to Azure SQL database. My SQL database query function returns the data, but I can't link it to the data attribute of my Grid.js table. See the attached images for more information.

Grid.js table:

Grid.js table

SQL function:

SQL function

SQL results:

SQL results



Solution 1:[1]

Below is the sample code,

const grid = new gridjs.Grid({
  columns: ['EmployeeID', 'FirstName', 'LastName', 'Address_1','HomePhone','CellPhone','Email','HourlyWage','credit_hours','SSN'],
  data => data.map(x => [x.EmployeeID, x.FirstName, x.LastName, x.Address_1,x.HomePhone,x.CellPhone,x.Email,x.HourlyWage,x.credit_hours,x.SSN])
});
  • How to import server-side data check this link.
  • Dynamic data import check it here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RajkumarPalnati-MT