Button to copy a line of a subform

Questions related to customising nuBuilder Forte with JavaScript or PHP.

Button to copy a line of a subform

Unread postby kknm » Wed Oct 06, 2021 8:36 pm

Do you plan to add a 'copy line' button to the subform?
Or add it yourself to js?
kknm
 
Posts: 231
Joined: Sat Apr 11, 2020 7:33 am

Re: Button to copy a line of a subform

Unread postby kev1n » Wed Oct 06, 2021 9:21 pm

kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Button to copy a line of a subform

Unread postby kknm » Fri Oct 08, 2021 10:12 pm


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);
}
kknm
 
Posts: 231
Joined: Sat Apr 11, 2020 7:33 am

Re: Button to copy a line of a subform

Unread postby kev1n » Fri Oct 08, 2021 10:22 pm

Replace st with sfId.
kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Button to copy a line of a subform

Unread postby kknm » Fri Oct 08, 2021 10:40 pm

kev1n wrote:Replace st with sfId.

I've already used this ... but the last line is still visible.
kknm
 
Posts: 231
Joined: Sat Apr 11, 2020 7:33 am

Re: Button to copy a line of a subform

Unread postby kev1n » Fri Oct 08, 2021 11:18 pm

Screenshot please to show what you mean.
kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Button to copy a line of a subform

Unread postby kknm » Fri Oct 08, 2021 11:34 pm

lastrow.png
lastrow.png (72.08 KiB) Viewed 86 times

On the last line, the button should be hidden.And if there are no filled lines, then the button should also be hidden.
kknm
 
Posts: 231
Joined: Sat Apr 11, 2020 7:33 am

Re: Button to copy a line of a subform

Unread postby kev1n » Sat Oct 09, 2021 12:16 am

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
2021-10-08_164355.jpg (25.69 KiB) Viewed 83 times
kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Button to copy a line of a subform

Unread postby kknm » Mon Oct 11, 2021 11:44 pm

Now it works, but wrong ... The 'Clone' button is missing on the copied line, but it appears on the last line.
clone.png
clone.png (6.86 KiB) Viewed 37 times

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.
kknm
 
Posts: 231
Joined: Sat Apr 11, 2020 7:33 am


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 5 guests