yuuvis® RAD Q&A

0 votes
by (640 points)

I used this sample code on how to clear table rows.
https://developer.enaio.org/redline/display/DD/Client-side Form Scripting#Client-sideFormScripting-TABLE

After using it on Enaio 4.12 version, the table can't be updated anymore.

I mean, after running this code part

table.value=[];

this part of code doesn't work anymore:

table.value.push(
                {
                    accepted: i%2,                              // Boolean
                    created: moment().add(i,'day').toDate(),        // Date
                    activedate: moment().add(i,'day').toDate(),     // Another date
                    author: 'Marie Curie '+i,                       // String: Author name with i postfix
                    prio: i+.42,                                    // Decimal
                    company : 'OSVH'                                // Codesystem - the 'data' values must be used.
                }
            )

New rows can't be inserted by script, if previous rows were removed. Is it a bug or there is a change for this functionality in 4.12 version?

1 Answer

0 votes
by (18.5k points)
edited by

Sorry, there was a code change beginning with 4.0 for resetting the rows of a tables. The effect comes form using mobx now.

In version 4.x use

table.value.length=0;

instead of

table.value=[];

...