Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

using the button to add a row above instead of below

Avatar

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile
kitturaw4922957
Level 1

28-09-2017

I am trying to create a table that will allow a user to hit a "button" and instead of the row being added to the bottom, I want it to be added to the top.

1313114_pastedImage_0.png

to this

1313115_pastedImage_1.png

I can get it to work only if the new row is added to the bottom. But this table sits at the bottom of the page, so I want it to build up.  I would appreciate any help at all.

Thank you!

Kitty

Accepted Solutions (0)

Answers (9)

Answers (9)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

05-10-2017

It would be in the button which adds a new row

Avatar

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile
kitturaw4922957
Level 1

05-10-2017

Forgive a stupid question be where would I enter this?

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

04-10-2017

Hi

How about trying to add the instance to the top as suggested before and then in the same event code change the Y position of the top of the table.

So as the table gets longer by a row height, the table Y position moves up by the same row height effectively looking like the bottom of the table stays where it is.

For example

//2in is the Y value of 2 inches

//use a variable to capture it's current position and calculate a new y value for it when the button is clicked.

Table1.y = "2in"; //javascript set Y position

Table1.y = "2in" //FormCalc set Y position

I found in my tests that this code by default returned a mm position eg: 69.85mm which meant i couldnt subtract the row height from it because of the text "mm"

If you can figure out how to get just the raw number Y value, make the calculation and give the table the new Y value, this might do what you are after.

Avatar

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile
kitturaw4922957
Level 1

04-10-2017

I want the new blank rows to build up.

1317716_pastedImage_2.png

1317702_pastedImage_0.png

Kind of like this. I want the new blank row to go on top of the old row without the whole table moving down.(Newest on top).

That bottom row that has the text rev level is at the bottom of the page. 

Does this make sense?

Kitty

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

04-10-2017

Hi Kitty,

So what is meant to happen with the rows that no longer fit on the page?

Bruce

Avatar

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile
kitturaw4922957
Level 1

03-10-2017

Thank you but, it needs to be on one page.

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

02-10-2017

If your row is going over your footer, you might need to make the table break over pages or adjust your content area.

Avatar

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
kitturaw4922957
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
View profile
kitturaw4922957
Level 1

02-10-2017

Not Exactly, I have:

this.resolveNode('RevTable._Row1').addInstance(1);

if (xfa.host.version < 😎 {

xfa.form.recalculate(1);

Ok getting closer. I used your suggestion above.

It added it to the top, but it moved everything down so the bottom row is now over top the footer.

so from this

1316346_pastedImage_2.png

to this

1316347_pastedImage_3.png

My goal is to have the table in the "rev level" column to show c,b, rev level.

Once I add even more rows the "b" row is now off the page.

Thank you,

Kitty

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

01-10-2017

Hi Kitty,

To add a row to the bottom, you probably have something like;

this.resolveNode('Table1._Row1').addInstance(true);

You just need to change the addInstance() to inserInstance(0, true), zero being the position to insert the row at.

this.resolveNode('Table1._Row1').insertInstance(0, true);

Regards

Bruce