ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: stoodin on June 02, 2014, 11:07:32 pm

Title: Additional meta data in the datamodel
Post by: stoodin on June 02, 2014, 11:07:32 pm
Hi,
I there anyway to keep additional meta data in the datamodel and what is the best way to do that?
For example in the grid I have a dropdown column which I populate from DB and show a description property only which maps directly to the grid datamodel.
Each object in the dropdown has a pkey but I am not sure how to store it within the grid and more importantly how to get the pkey when user selects the description from the dropdown.
Thank you as always.
Title: Re: Additional meta data in the datamodel
Post by: paramvir on June 03, 2014, 12:24:14 pm
In the grid dataModel, pkey can be stored in a hidden column.

while json data format can be used for the editor.options, pkey can be stored as valueIndx while description as labelIndx.

Please refer to the API:
http://paramquery.com/pro/api#option-column-editor

you might also need to implement editor.getData callback to fetch both pkey and description from the editor.
Title: Re: Additional meta data in the datamodel
Post by: stoodin on June 03, 2014, 06:21:47 pm
Excellent, thanks a lot