ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: youngfitz on September 27, 2018, 06:29:30 pm

Title: Pass in a JSON object with a class object and use properties as dataIndx
Post by: youngfitz on September 27, 2018, 06:29:30 pm
Hi,

I wanted to check if its possible to pass in a JSON object with a class object (TestClass below) and bind the Desc field of this as the dataIndx for the column?
So the property binded to the Column would be TestClass.Desc

     {
      "OrderID": 10702,
      "CustomerName": "ALFKI",
      "EmployeeName": "Peacock",
      "TestClass": {
        "ID": 1,
        "Desc": "Gary"

      }

Thanks,
Title: Re: Pass in a JSON object with a class object and use properties as dataIndx
Post by: paramvir on September 27, 2018, 06:35:11 pm
It can be done by hiding TestClass column and adding another formula column to extract value.

Code: [Select]
formula: function( rowData ){
  return rowData.TestClass.Desc
}
Title: Re: Pass in a JSON object with a class object and use properties as dataIndx
Post by: youngfitz on September 27, 2018, 07:25:42 pm
Thanks for the reply.
Have you a link to a working example of documentation on it?

Thanks,