Javascript method of accessing grid rows

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
esdaled
Profound User
Posts: 72
Joined: Fri May 08, 2009 2:43 pm
First Name: David
Last Name: Esdale
Company Name: Guardian General Insurance
City: Port of Spain
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Location: Trinidad
Contact:

Javascript method of accessing grid rows

Post 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?
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Javascript method of accessing grid rows

Post by Brian »

Is this grid a page at a time subfile or a load all?
esdaled
Profound User
Posts: 72
Joined: Fri May 08, 2009 2:43 pm
First Name: David
Last Name: Esdale
Company Name: Guardian General Insurance
City: Port of Spain
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Location: Trinidad
Contact:

Re: Javascript method of accessing grid rows

Post by esdaled »

A page at a time subfile.
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Javascript method of accessing grid rows

Post 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?
esdaled
Profound User
Posts: 72
Joined: Fri May 08, 2009 2:43 pm
First Name: David
Last Name: Esdale
Company Name: Guardian General Insurance
City: Port of Spain
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Location: Trinidad
Contact:

Re: Javascript method of accessing grid rows

Post by esdaled »

I should be able to. Thanks.
esdaled
Profound User
Posts: 72
Joined: Fri May 08, 2009 2:43 pm
First Name: David
Last Name: Esdale
Company Name: Guardian General Insurance
City: Port of Spain
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Location: Trinidad
Contact:

Re: Javascript method of accessing grid rows

Post 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.
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Javascript method of accessing grid rows

Post by Brian »

is the grid using the scroll bar or paging bar?
esdaled
Profound User
Posts: 72
Joined: Fri May 08, 2009 2:43 pm
First Name: David
Last Name: Esdale
Company Name: Guardian General Insurance
City: Port of Spain
State / Province: Outside Canada/USA
Country: Trinidad and Tobago
Location: Trinidad
Contact:

Re: Javascript method of accessing grid rows

Post by esdaled »

scroll bar
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Javascript method of accessing grid rows

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests