Highlighted

add Row

Avatar

Guest

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

Highlighted

pguerett

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?
Highlighted

Avatar

Guest

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);

}
Highlighted

pguerett

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.