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.
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Fri Jan 12, 2018 6:11 am
Hi,
In nuBuilderPro I use nuSubformArray() and loop through the subform to obtain the Prefix keys in order to retrieve and set values.
How can I set values in nuBuilderForte?
Code: Select all
var subFormPrefixes = nuSubformArray('nuSubFormXYZ', false);
for (var index in subFormPrefixes) {
//e.g. obtaining a value:
var ddate = $('#' + subFormPrefixes[index] + 'absdates_date').val();
// Set a value..
$('#' + subFormPrefixes[index] + 'absdates_hours').val("");
}
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Fri Jan 12, 2018 7:51 pm
I see. Is it also possible then to modify its values and write them back.to the grid?
admin
Site Admin
Posts: 2814 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times
Unread post
by admin » Fri Jan 12, 2018 8:08 pm
toms,
There is no function to do that.
Steven
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Fri Jan 12, 2018 9:30 pm
I see. I need to figure out a way to do it. Since I need to set some default values after adding a row / multiple rows by code.
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Sun Jan 14, 2018 11:08 am
I'm not sure how to implement it. Adding an afterinsertrow event handler in the subform object doesn't fire the js.
Adding an afterinsertrow in the main form directly doesn't help either.
And, what are the parameters of that function. I need to get a reference to the inserted row.
Could you shed a light on this?
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times
Unread post
by admin » Sun Jan 14, 2018 5:32 pm
toms,
Event is a nuScroll Object that you can scroll up and down in (giving you different events).
I think what you have done is typed it in manually and it needs to be all lowercase.
Try that.
Steven
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Tue Jan 16, 2018 1:23 am
afterinsertrow fires now.
you can use to prepopulate Objects in new rows afterinsertrow...
How can I do that? After adding a new row, some default values should be set in the new row.
admin
Site Admin
Posts: 2814 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times
Unread post
by admin » Tue Jan 16, 2018 1:00 pm
toms,
Add an Event, as below...
afterinsertrow2.png
And this to the Javascript of the Form...
Code: Select all
function fillNewRow(){
var r = nuSubformObject('sf').rows.length - 1;
$('#sf' + nuPad3(r) + 'field00').val('hello');
$('#sf' + nuPad3(r) + 'field01').val('world');
}
Steven
You do not have the required permissions to view the files attached to this post.