createCustomList - tables

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

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

createCustomList - tables

#1

Postby Steve James » Tue Jul 01, 2014 9:03 am

If I have a static or dynamic list attached to a table column the list attaches to all records.

However if I use createCustomList it only attaches to the current record

eg

Code: Select all

var list = tables.TABLE.COLUMN.createCustomList(["Line 1", "Line 2", "Line 3"]);
This, in some ways, makes sense ie tables.TABLE.COLUMN...... affects only the current record but in other ways doesn't make sense ie STATIC and DYNAMIC lists attach to all records in the table.

1 - is this the expected behaviour?

2 - Is it possible to attach the list to all records in the table (other than looping through each record)?

Thanks
0 x

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

#2

Postby Jon » Tue Jul 01, 2014 12:26 pm

If you attach the list before loading any data into the table, it should become the default for all added rows. But as you say, if data already exists and therefore the table has a "current row", the list will be applied just to that row.

Regards
Jon
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#3

Postby Steve James » Tue Jul 01, 2014 1:58 pm

Hi Jon, thanks, that makes sense and yes it works except for the fact that it appears I can only attach 1 createCustomList to 1 column in a table prior to loading data into it.

Eg
I have a table with a number of columns, several of which require a dropdown. I want to use custom lists rather than dynamic or static.

I have a table with the dropdown values. I fetch this table, loop through the records and associate the drop down values to the appropriate list.

I then want to attach the appropriate list to the relevant column.

If I try to attach the lists to the table before adding data then only the first list is attached.

If I loop through the table I can attach the correct list to the correct column for all records.

I've created a form which queries an Ebase repository table just to prove the point if you need it.

Thanks
Steve
0 x

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

#4

Postby Jon » Tue Jul 01, 2014 2:50 pm

Steve,

This is a bug which we will attempt to fix. In the meantime, I'm afraid you'll need to loop through the rows and set your lists on each one.

Regards
Jon
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#5

Postby Steve James » Wed Jul 02, 2014 6:27 am

Thanks Jon, no worries, looping through the table is easy enough in the short term.

If the table is massive then we may selectively attach the lists to the columns.

Steve
0 x


Who is online

Users browsing this forum: No registered users and 6 guests