Expand my Community achievements bar.

Get Row Type on the fly

Avatar

Level 2

I have a row in a table.  A row can be of type 'Body Row', 'Header Row', or 'Footer Row.'

How do I return the type using Javascript?

For example I want to write something like this:  xfa.host.messagBox(form1.Table1.Row1.Type.value);

Hope you guys can help thank you

5 Replies

Avatar

Level 10

Hi,

Putting this directly into a cell (in a table), returns the "name" of the parent container, eg is the cell in the Header Row, Body Row or Footer Row:

this.rawValue = this.parent.name; 

Now you would need to extend this:

xfa.host.messagBox(form1.Table1.Row1.name);

This may work, you would have to try it and amend if necessary.

Good luck,

Niall

Avatar

Level 2

Niall, this doesn't help me at all.  I'm trying to get the TYPE of row.  I want to determine whether the object is a Body Row or a Header Row.

Getting the name wont help, on default all rows are named Row1, Row2 etc.  Also anyone can change the name of Row object.

I need a way to identify the "TYPE" of Row.

Please help thanks 

Avatar

Level 10

Ok,

Try this for size:

this.rawValue = this.parent.assist.role;

which would look something like:

xfa.host.messagBox(form1.Table1.Row1.assist.role);

This will return TH for header rows; TR for body rows and TF for footer rows. A switch statement can convert these into text strings.

Hope that helps. I can do a sample if you want.

Niall

Avatar

Level 2

hahaha thats perfect Naill.  exactly what I'm looking for.

You can be my hero again.

BTW. if the solution wasnt so obscure I could have looked it up myself.

Avatar

Level 10

Hi,

Got there in the end!!

Tip:

It is always worth selecting an object and having a look in the XML Source tab. It is all laid out there, which helps creating script

Windows 71.png

Good luck,

Niall