add Row

Avatar

06-10-2008

Hi I need to add a sequence in my rows. At this moment I succeeded to add a row by clicking a button, but now I need to have a colon with Employee 1 for he first row and when I then add a 2nd row it has to say Employee 2 and so on.



Which code do I need?

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

07-10-2008

You would have to determine which row instance you are on and then modify the text to display the correct name.



Do you have a button to remove an instance? That would make it difficult to keep the rows in sync with the numbers.



Are you able to write code?

Avatar

07-10-2008

Paul,



I use a button ro remove an instance but it is not necessary.



The code I use is Javascript and it is a click-event



if(Incitant51.subFoire.all.length < 5){;

Incitant51.subFoire.instanceManager.addInstance(true);

}

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

08-10-2008

You can use the parent.index on an object inside of the subform to determine which instance that you are on. Then you can use that in combination with the string Employee to get your desired result. If you allow for deleting instances then you will have to recalculate each row everytime someone deletes a row.