onClick / row property on subfile field

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
hbi
Profound User
Posts: 24
Joined: Sun Oct 30, 2011 1:04 pm
First Name: Helge
Last Name: Bichel
Company Name: Helge Bichel
Country: Denmark
Contact:

onClick / row property on subfile field

Post by hbi »

Need some help with the ROW property on a subfile field.

From other topics in this forum I can see that there is a ROW property (or variable) giving the actual row for a subfile field.

I am trying to create an onClick script for a subfile field resulting in change of an option field in the same row and then generate an Enter (submit). The Enter works fine, but the reference to the row doesn't work. Sure I am doing something wrong.

The script is the OnClick is:
changeElementValue("S1X.row","2");pui.click("btnSubmit");
This should change the S1X (an option field) on the same row as the clicked field to '2', but it doesn't do it. If I change the row to a fixed number it works.

Ideas about what I am doing wrong ?

Brgds
Helge
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: onClick / row property on subfile field

Post by Brian »

Try:

changeElementValue("S1X." + row,"2");pui.click("btnSubmit");
hbi
Profound User
Posts: 24
Joined: Sun Oct 30, 2011 1:04 pm
First Name: Helge
Last Name: Bichel
Company Name: Helge Bichel
Country: Denmark
Contact:

Re: onClick / row property on subfile field

Post by hbi »

Doesn't work.
I get
OnClik Error: 'row' not defined.
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: onClick / row property on subfile field

Post by Brian »

Ok, so you are on the onclick event of an individual field in the grid. Now I understand your dilemma.

Try this:

var id = this.id; row=id.split(".")[1];changeElementValue("S1X." + row,"2");pui.click("btnSubmit");

This should retrieve the current elements id, which will include the row number. The split function will split the id at the period and return the second half ([1]) which is the row number. Then the code I gave you previously should work. I did not get a chance to test this, but it should work.
hbi
Profound User
Posts: 24
Joined: Sun Oct 30, 2011 1:04 pm
First Name: Helge
Last Name: Bichel
Company Name: Helge Bichel
Country: Denmark
Contact:

Re: onClick / row property on subfile field

Post by hbi »

Dear Brian.

That works ! Thank you very much.

Brds
Helge
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests