ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: jax on June 23, 2014, 07:22:20 am

Title: JSON Data with Child Objects
Post by: jax on June 23, 2014, 07:22:20 am
I have JSON being returned to the grid and the top level JSON object is binding correctly. However, if I try to bind to the Child object properties it does not work . For example, the Facility.Name is not being set, but the last and first names are. If I write data[0].Facility.Name to the console I am able to see the child object property so I know the data is there and valid. How is this handled with param query?

        var colM = [
            { title: 'Last Name', width: 100, dataIndx: 'LastName', dataType: 'string' },
            { title: 'First Name', width: 100, dataIndx: 'FirstName', dataType: 'string' },
            { title: 'Facility', width: 100, dataIndx: "Facility.Name", dataType: 'string' },
        ];
Title: Re: JSON Data with Child Objects
Post by: paramvir on June 23, 2014, 08:38:44 am
you could use column.render callback function for that.

render: function(ui){
  return ui.rowData['Facility']['Name'];
}
Title: Re: JSON Data with Child Objects
Post by: jax on June 23, 2014, 08:46:59 am
Thanks that works :)