Page 1 of 1

Client side javascript - get grid selected row values

Posted: Wed Nov 06, 2019 3:42 pm
by Bernie
I am trying to set some data elements on the screen based on what row was selected in a grid. So basically I want to get the grid column values for the selected row when onrowclick event is triggered. I then want to place these into some other fields to do updating. This is more of a test process just to know I am able to move or condition data from what has been selected in the grid and put it somewhere else.

Anyway, I have the following in the onrowclick event and it fails when I select the row with error "Cannot read property 'grid' of null".

var value = getObj("gridParts").grid.getCellValue(row, 0);
changeElementValue("getpart", value);

My grid is labeled gridParts and the output field on the screen is getpart.

Re: Client side javascript - get grid selected row values

Posted: Wed Nov 06, 2019 5:19 pm
by Bernie
Just a quick follow up on this so far. I was able to get it to work. I changed it to the following:
var value = getObj("Grid1").grid.getCellValue(rowNumber, 1);
changeElementValue("TextBox1", value);

I had to set it to the actual id of the element instead of the named value.

Re: Client side javascript - get grid selected row values

Posted: Wed Mar 04, 2020 11:37 am
by SrinivasSiripuram
Hi,
I am trying to get the grid selected row number, on grid row double click event in javascript,
can you please some one help me how to get the clicked row number
on grid row double click.