ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: omerix on March 21, 2019, 05:45:48 pm

Title: Selected ID
Post by: omerix on March 21, 2019, 05:45:48 pm
Hello,

How do I get the ID number of the selected fields?

https://yadi.sk/i/cp5BSgn7Bpdrew

Console.log () is enough
Title: Re: Selected ID
Post by: paramvir on March 21, 2019, 05:51:23 pm
Ex: https://paramquery.com/pro/demos/selection_cell

Cell selections are rectangular in shape.

selectChange event provides selection information in form of beginning rowIndx (r1) to end rowIndx (r2) and beginning colIndx (c1) to end colIndx (c2)

Code: [Select]
[{"r1":3,"c1":5,"firstR":3,"firstC":5,"r2":3,"c2":5,"rc":null,"cc":null,"type":"cell"}]
Title: Re: Selected ID
Post by: omerix on March 25, 2019, 04:14:23 pm
Hello,

I got the "ID" of the selected records. I assigned it to "Input.value".

But how do I get the "dataIndx" information of the selected records? (getCellHeader, gettCell etc.?)


Code: [Select]
,selectChange: function (evt, ui) {
var selectJson=JSON.stringify(ui.selection.address());
var selectArray=JSON.parse(selectJson);
var selected=selectArray[0];
if (selected==undefined){} else{
var rowStart=selected.r1;var rowStop=selected.r2;var cellStart=selected.c1;var cellStop=selected.c2;
$('#r1').val(rowStart);$('#r2').val(rowStop);$('#c1').val(cellStart);$('#c2').val(cellStop);
var selectedValue=[];
for (i = rowStart; i <= rowStop; i++) {selectedValue.push(grid.getRowData({rowIndx:i})['ID']);}
$('#dtaLabel').val('TODO-Coll.DataIndx');
$('#dtaValue').val(selectedValue.join());
}}
Title: Re: Selected ID
Post by: paramvir on March 25, 2019, 05:15:55 pm
dataIndx can be obtained from colIndx

Code: [Select]
grid.getColModel()[ cellStart ].dataIndx;
Title: Re: Selected ID
Post by: omerix on March 26, 2019, 01:24:47 am
Thanks param.

dataIndx can be obtained from colIndx

Code: [Select]
grid.getColModel()[ cellStart ].dataIndx;