Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Button to copy a line of a subform

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Button to copy a line of a subform

Unread post by kknm »

Do you plan to add a 'copy line' button to the subform?
Or add it yourself to js?
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Button to copy a line of a subform

Unread post 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);
}
kev1n
nuBuilder Team
Posts: 4300
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Button to copy a line of a subform

Unread post by kev1n »

Replace st with sfId.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Button to copy a line of a subform

Unread post by kknm »

kev1n wrote:Replace st with sfId.
I've already used this ... but the last line is still visible.
kev1n
nuBuilder Team
Posts: 4300
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Button to copy a line of a subform

Unread post by kev1n »

Screenshot please to show what you mean.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Button to copy a line of a subform

Unread post 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.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4300
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Button to copy a line of a subform

Unread post 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
You do not have the required permissions to view the files attached to this post.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Button to copy a line of a subform

Unread post 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.
You do not have the required permissions to view the files attached to this post.
Post Reply