Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Questions related to using nuBuilder Forte.
marc
Posts: 92 Joined: Mon May 14, 2018 3:26 pm
Unread post
by marc » Sun Jul 08, 2018 6:39 am
Hey,
I created a form that contains a subform grid. Upon loading the edit screen, I run a script to add some additional rows to the subform.
Like this:
Code: Select all
nuAddRow('sub_grid' );
nuAddRow('sub_grid' );
nuAddRow('sub_grid' );
nuAddRow('sub_grid' );
nuAddRow('sub_grid' );
But just one row is added, not 5!
Test done with a nuBuilder Form: Same result!
addrow.JPG
Code: Select all
nuAddRow('accform' );
nuAddRow('accform' );
nuAddRow('accform' );
nuAddRow('accform' );
How do I prepopulate more than one row?
You do not have the required permissions to view the files attached to this post.
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Mon Jul 09, 2018 8:37 am
marc,
It works for me - but only if the first control is a not a lookup object. It seems to be a glitch.
Workaround: add a dummy input field as first element in the grid with width = 0 and disabled = false.
admin
Site Admin
Posts: 2815 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times
Unread post
by admin » Wed Jul 11, 2018 3:25 am
marc,
It works for me as well.
Steven
marc
Posts: 92 Joined: Mon May 14, 2018 3:26 pm
Unread post
by marc » Wed Jul 11, 2018 5:47 am
admin wrote: marc,
It works for me as well.
Steven
@Steven:
and you tried it on a subform where the first element is a lookup object?
(see my example above, access level screen, forms grid)
@toms: WIll give it a go unless there's a patch.
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Wed Jul 11, 2018 7:37 am
Timo, yes the issue
only occurs when the the
first object in a grid row is a
lookup object .
2018-07-11_073153.png
If you add several rows in one go, only 1 row will be added:
Code: Select all
nuAddRow('accform' );
nuAddRow('accform' );
nuAddRow('accform' );
nuAddRow('accform' );
nuAddRow('accform' );
Eg. if you add a timeout before adding a new row, all rows will be added.
Code: Select all
var d = 50;
for (i = 0; i < 20; i++) {
setTimeout(function() {
nuAddRow('accform' );
}, d);
d += 50;
}
You do not have the required permissions to view the files attached to this post.
marc
Posts: 92 Joined: Mon May 14, 2018 3:26 pm
Unread post
by marc » Fri Jul 20, 2018 3:50 pm
@Steven Have you been able to reproduce this bug?
the issue only occurs when the the first object in a grid row is a lookup object.
admin
Site Admin
Posts: 2815 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times
Unread post
by admin » Sun Jul 22, 2018 11:45 pm
marc,
No, I can't.
It works for me on Access Levels > Form Tab (which starts with a Lookup).
Steven
admin
Site Admin
Posts: 2815 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times
Unread post
by admin » Tue Jul 24, 2018 10:23 pm
marc,
It seems the process of loading a lookup in a new row (which may need data from the server) means you may need to pause between running nuAddRow().
I would just use toms workaround.
Steven
marc
Posts: 92 Joined: Mon May 14, 2018 3:26 pm
Unread post
by marc » Sat Jul 28, 2018 9:29 am
admin wrote:
It seems the process of loading a lookup in a new row (which may need data from the server) means you may need to pause between running nuAddRow().
Well, the adding works well if the lookup is not the first element in the row. That's why I think there's another reason.