Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

nuAddRow()

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
mariri
Posts: 45
Joined: Mon Sep 02, 2019 11:54 am

nuAddRow()

Unread post by mariri »

Hi !

How does the JavaScript function "nuAddRow()" work ?
In the JavaScript custom code of the main form, I have this following code to remove all the subform rows :

Code: Select all

var s = nuSubformObject('object_sf_id');
var r = s.rows;

for(var i = 0 ; i < r.length ; i++){
    var c = 'object_sf_id' + nuPad3(i) + 'nuRECORD';
    $('#' + c).remove();  
}
But then when I click on a button to add new empty row in the subform, nothing happens with the "nuAddRow()" function...

Thanks for ur help !
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: nuAddRow()

Unread post by kev1n »

nuAddRow() calls change() of the last row in the subform. Since all of them have been removed, the function fails.
nuaddrow.png
I guess you would have to write your own nuAddRow() function.
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: nuAddRow()

Unread post by admin »

mariri,

nuBuilder tracks things like how many rows there are, so removing them manually will create problems.

Why do you need to do this?


Steven
Post Reply