Closed nuclearsiloman closed 7 years ago
Can't you pass a function to get responseJson.data
to the grid component?
What is the data type in the server side?
I found another grid plugin that takes the json without issues. So I'm good thanks.
Hi. It's good that you found a solution. In case you find some time to give this project another try, what you missed is that when you parse a JSON array string, the parse method returns a jsonArray object that is the internal data representation:
Set JSON = new jsonObject
Set jArr = JSON.Parse(jsonArrString)
JSON.write() ' {"data":[...]}
jArr.Write() ' [...]
Your parser works great. But when I try to integrate the json with a jquery grid control I receive the following: tabulator.min.js:2 Data Loading Error - Unable to process data due to invalid data type Expecting: array Received: object Data: {data: Array(10)}
The produced json is: {"data":[{"idproduct":1,"description":"Lightweight Flannel","sku":"LGHTFLAN"},{"idproduct":2,"description":"The Unbutton-Down Shirt","sku":"ParentSKU-UNBTNDOWN"},{"idproduct":3,"description":"Daily Grind","sku":"DLYGRND"},{"idproduct":4,"description":"Daily Grind (Silver - navy - Small)","sku":"DLYGRNDnavy"},{"idproduct":5,"description":"Daily Grind (Silver - White - Small)","sku":"DLYGRNDwhite"},{"idproduct":6,"description":"Crown Prints 2","sku":"CRWNPRNTS"},{"idproduct":7,"description":"Duplicate SKU","sku":"Test123"},{"idproduct":8,"description":"$20 Gift Certificate","sku":"GC20"},{"idproduct":9,"description":"Plaid Tie","sku":"tie1"},{"idproduct":10,"description":"Sunset 1","sku":"sun1"}]}
Is there anything I can do to make this work? Thanks.