Adding table columns dynamically

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

Adding table columns dynamically

#1

Postby edwinayin@qq.com » Mon Dec 19, 2016 8:52 pm

Hello everyone,

I have two tables:

The first one allows the user to add rows, and for each addition, the second table should get an additional column.

Is there a way of doing this?

Thanks in advance!!

Edwina
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Tue Dec 20, 2016 3:00 pm

This is not possible to dynamically add table columns.

How many columns do you need to add? This seems a strange thing to want to do. If I understand you correctly, you want to add a new column every time a table row is added?

If you add 100 rows... do you want to add 100 columns?

Steve
0 x

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

#3

Postby edwinayin@qq.com » Tue Dec 20, 2016 5:12 pm

Hello Steve,

Yes, but I am going to store the second table differently in the database, from user's view, "column" is added, but in reality, "row" is added. And in reality, maximum 10 of the "columns" will be added.

I just need to find a way to display the table differently, ie. variable name on the left side instead of on the top of the table.

I am going to try repeater, but not sure whether that will work or not.

regards,
Edwina
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#4

Postby Segi » Tue Dec 20, 2016 5:20 pm

Edwina can you explain what it is you're trying to do exactly.

I don't know if this is what you're trying to do exactly but I created a simple project which has 2 non-database backed tables to make things simple.

Table 1 has 3 columns and an add row button. Table 2 has a total of 8 columns all of which are initially hidden. Whenever you click on add row in table 1, I loop through table 2 and find the next column going from left to right that is hidden and unhide that column so that every time you click on add row in table 1, another column from table 2 gets shown. I can send you this project if this what you are trying to do.
0 x

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

#5

Postby edwinayin@qq.com » Tue Dec 20, 2016 9:00 pm

Thank you so much Seji,

That's exactly what I am trying to do, I've never thought about doing it this way (using hide).

I tried the repeater, and it worked ok so far. So every time user click 'Add row' for the first table, the second 'table' will have an extra column.

But I really appreciate your suggestion, will try it soon.

regards,
Edwina
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#6

Postby Segi » Tue Dec 20, 2016 10:34 pm

No problem,

Here's the project in case you want to see how I did it:

https://ufile.io/0131c
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#7

Postby Jon » Wed Dec 21, 2016 9:30 am

A Custom Layout on a Repeater might let you do what you want to do.
0 x


Who is online

Users browsing this forum: No registered users and 47 guests