I have a huge table. It starts with 6 columns, afterwards there are 9 columns. The table has 9 columns for 25 rows. After that the table has 4 columns (don’t know if this matters) Now what I want to do, this form is an expenses form and when the user hasn’t enough with the 25 rows he should be able to insert a row by clicking a button or something. Would this be possible? Or should I consider another solution?
Subject: is it possible to insert a row in web application
In short, you can’t do that.
Your best bet will probably be to use other fields to make records within the document.
For example, if you had 3 columns, for date, decription and amount, you would set up 3 fields called “DATA_Date” (Multivalue, date field), “DATA_Description” (multivalue, text), “DATA_Amount” (multivalue number)
I usually hide these, and place them just above the table that will display them.
Then, set up the table header in HTML on the form.
Next, you add a field which will produce TR tags for each record in the fields above. You can do this as follows:
“[TR][TD]” + @Date(DATA_Date) + “[/TD][TD]” + DATA_Description + “[/TD][TD]” + @Text(DATA_Amount;“F2”) + [/TD][/TR]"
then finish the table in HTML.
You then need to add fields at the bottom which take new values and append them to the lists.
It works a little differently in notes, though - You need to have a row for the table header, a row to show the data and a row to show the totals
In the data row, you have display field which shows the DATA_Field’s data, each value on a new line.
Hope that helps.
Kiers
Subject: RE: is it possible to insert a row in web application
Hi Kieran,
I looked for some information for the method you proposed. I think it’s good solution, but I don’t understand it completely.
In the sandbox is a TableWalker available. I want to implement that in my datbase.
Allthough the things you explain here look a little bit less complicated.
Unfortunately I don’t understand everything you say. My table is made in notes. How can I implement what you said? How do the values I fill in get transfered to the display fields? How can I calculate the totals from the multivalue fields?
Regards and thanks for your responses
Subject: RE: is it possible to insert a row in web application
Bram,
I’ve emailed you - it was easier to sendyou an example, rather than trying to explain all the settings.
There were a few gotchas anyway - like needing to have “generate HTML for all fields” set.
Hope that’s ok.
Kiers
Subject: You can add rows with JavaScript
Subject: RE: You can add rows with JavaScript
Yes, that’s true. But…
How would this then be displayed when the document is re-opened by another user?
You’d have to add new fields into the row, which would then need to be added on the Notes Form to allow the document to save correctly.
Also, How would you handle the totals columns? you’d have to have the Javascript handling the computations.
What about if opened in notes? Notes can’t do dynamic tables very well at the moment.
The “records within multivalue fields” option gives you very high capacity while staying at the data level with no only 1 (possibly 2) fields per column, rather than one field per cell.
It’s a much easier design to maintain, as you don’t have to make massive changes to total fields, or to allow for new fields.
Subject: RE: You can add rows with JavaScript
Have you looked into Midas?