Page 1 of 1

Button to copy a line of a subform

Posted: Wed Oct 06, 2021 1:06 pm
by kknm
Do you plan to add a 'copy line' button to the subform?
Or add it yourself to js?

Re: Button to copy a line of a subform

Posted: Wed Oct 06, 2021 1:51 pm
by kev1n

Re: Button to copy a line of a subform

Posted: Fri Oct 08, 2021 2:42 pm
by kknm
An error in this function - the st variable is missing:

Code: Select all

function hideLastCloneButton() {

  var r = nuPad3(nuSubformObject(sfId).rows.length - 1);
  cloneButton = st + nuPad3(r) + btnCloneId;
  nuHide(cloneButton);
}

Re: Button to copy a line of a subform

Posted: Fri Oct 08, 2021 2:52 pm
by kev1n
Replace st with sfId.

Re: Button to copy a line of a subform

Posted: Fri Oct 08, 2021 3:10 pm
by kknm
kev1n wrote:Replace st with sfId.
I've already used this ... but the last line is still visible.

Re: Button to copy a line of a subform

Posted: Fri Oct 08, 2021 3:48 pm
by kev1n
Screenshot please to show what you mean.

Re: Button to copy a line of a subform

Posted: Fri Oct 08, 2021 4:04 pm
by kknm
lastrow.png
On the last line, the button should be hidden.And if there are no filled lines, then the button should also be hidden.

Re: Button to copy a line of a subform

Posted: Fri Oct 08, 2021 4:46 pm
by kev1n
Did you add an afterinsertrow event as described in the article? This will hide the clone button of the last row.
2021-10-08_164355.jpg

Re: Button to copy a line of a subform

Posted: Mon Oct 11, 2021 4:14 pm
by kknm
Now it works, but wrong ... The 'Clone' button is missing on the copied line, but it appears on the last line.
clone.png
But if you save after each copy, then everything is displayed correctly, but this is the wrong editing method.
I also find it a disadvantage that the cloning function is slow. With 12 columns, after pressing the copy button, the function starts working after 2-3 seconds.