Page 1 of 1

nuAddRow()

Posted: Tue Jan 21, 2020 1:59 pm
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 !

Re: nuAddRow()

Posted: Wed Jan 22, 2020 6:34 am
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.

Re: nuAddRow()

Posted: Tue Feb 18, 2020 10:48 pm
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