ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: omerix on March 20, 2014, 03:50:09 pm

Title: Cell in Selected.Text
Post by: omerix on March 20, 2014, 03:50:09 pm
Hello Param,

I am using <select> in a cell in ParamGrid.
Values of the options are 1001,1002,1003, and texts are like "Inspection Formu", "Ek Dosya (Upload)"

When grid is first viewed , it shows user values as attached.
This is not easy to read. Therefore is it possible to Show the text when cell is selected?

As I could not do that I needed to Show it in 2 columns. But this is problem on user side.
Title: Re: Cell in Selected.Text
Post by: paramvir on March 21, 2014, 09:42:16 am
I understand that you want to keep 'values' in the data but want to show 'text' in the cells.

You could use column.render callback to do that.

In this callback you get the value as ui.rowData[ui.dataIndx].

Next you can fetch the corresponding text to this value and return the text.

render(ui){
   var val = ui.rowData[ui.dataIndx];
   //get text corresponding to val depending upon your data structure of the select list options.
   return text;
}

If you don't want to reference select list options in the render callback, you can save data in this format {val: val, text: text} using editor.getData callback.

then you can easily reference text in render callback.

render(ui){
   var obj = ui.rowData[ui.dataIndx];
   //get text from obj
   return obj.text;
}