Delete row in a table

Avatar

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Staffle
Level 1

19-08-2015

Adding table rows works fine when I use this script: Table.Row1.instanceManager.addInstance(1);

When users click Delete, it always deletes the second (and shifts the rest up), no matter what row they want to delete. I have the following script to delete a table row:

Table.Row1.instanceManager.removeInstance(1);

What do I need to change in order to delete the row that is clicked?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

19-08-2015

Hi there,

add an instance is easy as you only need to specify true or false (1 or 0)

but for deleting row it is a little different, instead or specifying true of false, you need to specify which row you want to delete...

If your delete button is inside the row itself, you can use the index of the parent's row of the delete button

Table.Row1.instanceManager.removeInstance(this.parent.parent.index);

Answers (2)

Answers (2)

Avatar

Avatar
Boost 3
Level 2
_Sid_
Level 2

Likes

3 likes

Total Posts

47 posts

Correct reply

6 solutions
Top badges earned
Boost 3
Boost 1
Applaud 5
Affirm 5
Affirm 3
View profile

Avatar
Boost 3
Level 2
_Sid_
Level 2

Likes

3 likes

Total Posts

47 posts

Correct reply

6 solutions
Top badges earned
Boost 3
Boost 1
Applaud 5
Affirm 5
Affirm 3
View profile
_Sid_
Level 2

19-08-2015

As stated by Magus069‌, it's better to have a delete button with each row, since that simplifies your script for deletion (it's pretty much repetition), and secondly having individual delete buttons, give users the power to choose which row they specifically want to delete.

Avatar

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Staffle
Level 1

19-08-2015

Thanks a mill Magus!

Works like a charm !