Expand my Community achievements bar.

add Row

Avatar

Former Community Member
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?
3 Replies

Avatar

Former Community Member
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

Former Community Member
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

Former Community Member
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.