Page 1 of 1

Javascript method of accessing grid rows

Posted: Wed May 23, 2012 11:56 am
by esdaled
I am working with a grid which has a checkbox to select rows for subsequent processing. The user can check multiple rows.

I am trying to use some javaScript to display a count of the number of grid rows which have been selected.

I have tried using the following code associated with the checkbox's onChange event:

Code: Select all

	var nbrChecked = 0;
	var row = 1;
	while (getObj('SELEC.'+row)){
		if (getObj('SELEC.'+row).checked==true){
			nbrChecked++;
		}
  		row++;
  	}

	changeElementValue("selecCount", nbrChecked);
The code only works when the user is on page one. When on page two 'SELEC.1' is undefined.

Is there a way of accessing information on rows which have been sent to the browser but aren't on the current page? or do you have an alternate suggestion?

Re: Javascript method of accessing grid rows

Posted: Thu May 24, 2012 9:38 am
by Brian
Is this grid a page at a time subfile or a load all?

Re: Javascript method of accessing grid rows

Posted: Thu May 24, 2012 11:47 am
by esdaled
A page at a time subfile.

Re: Javascript method of accessing grid rows

Posted: Fri May 25, 2012 2:23 pm
by Brian
Ok. So because this is a page at a time subfile, the only rows that exist at a given time are the ones displayed. Accessing elements off page just won't be possible.

Any way you could make this a load all subfile?

Re: Javascript method of accessing grid rows

Posted: Fri May 25, 2012 3:00 pm
by esdaled
I should be able to. Thanks.

Re: Javascript method of accessing grid rows

Posted: Fri May 25, 2012 3:14 pm
by esdaled
I have changed my grid to a load all subfile, but the code quoted previously now only works if row 1 is visible.

Re: Javascript method of accessing grid rows

Posted: Fri May 25, 2012 3:54 pm
by Brian
is the grid using the scroll bar or paging bar?

Re: Javascript method of accessing grid rows

Posted: Fri May 25, 2012 4:17 pm
by esdaled
scroll bar

Re: Javascript method of accessing grid rows

Posted: Fri Jun 01, 2012 5:10 pm
by David
Profound UI's grid renders only the records which are currently visible. So if they are not currently in view, the widgets are not rendered.

Of course the rendering framework does have the data for all records which were sent to the browser, but there is not currently an interface to this.