Page 1 of 1
Cloned subform is empty
Posted: Sat Mar 30, 2024 7:07 am
by shuray
Hi.
I have a form with 2 subforms. One of them is cloneable, the second is not.
When I press the Clone button, the first form remains filled up with records (and it is perfect), but the second becomes totally empty, even without starting empty row, so I cannot fill this subform by new records.
I need tht starting row in the second subform.
How to display it?
Re: Cloned subform is empty
Posted: Sat Mar 30, 2024 8:04 am
by kev1n
Hi,
Could you try this updated nuEmptyNoClone() function ? Replace the one in nuform.js.
Code: Select all
function nuEmptyNoClone() {
const noclone = nuSERVERRESPONSE.noclone;
if (!noclone || !Array.isArray(noclone)) return;
noclone.forEach(function(item) {
if (item.subform) {
$('#' + item.id + 'scrollDiv .nuSubform1, #' + item.id + 'scrollDiv .nuSubform0').each(function() {
if (this.id !== item.id + '000nuRECORD') {
$(this).remove();
}
});
$('#' + item.id + '000nuRECORD').children().each(function() {
if ($(this).hasClass('nuEdited')) {
$(this).val('');
if ($('#' + this.id + 'button').length) {
$('#' + this.id + 'code, #' + this.id + 'description').val('');
}
}
});
$('#' + item.id + '000nuDelete').prop('checked', true);
$('#' + item.id + '001nuRECORD').remove();
} else {
$('#' + item.id).val('').trigger("change");
}
});
}
Re: Cloned subform is empty
Posted: Sat Mar 30, 2024 7:39 pm
by shuray
kev1n wrote: ↑Sat Mar 30, 2024 8:04 am
Hi,
Could you try this updated nuEmptyNoClone() function ? Replace the one in nuform.js.
...
It is working.
Thank you, Kev1n!
Re: Cloned subform is empty
Posted: Thu May 09, 2024 9:57 pm
by databs1234
I'm not certain if my issue is the same, when cloning a subform the subform looks fine but after saving the object list is empty on the new cloned subform. Is this a fix for this issue? Thanks.
Re: Cloned subform is empty
Posted: Fri May 10, 2024 6:57 am
by kev1n
I just tried to clone an access level and I don't experience that problem.
Please provide more details.
Re: Cloned subform is empty
Posted: Wed May 29, 2024 3:27 pm
by databs1234
the issue is when cloning a form based upon a view, when I cloned the same form based upon a table it worked, but when cloning a form based upon a view, the object list is empty. I can create the form manually and input the objects using fast form, there is a word around, just could not figure out why the object list was empty. Thanks.