Hi
When I want to add a new row in a subforum it's in the bottom of the grid. This is not so userfriendly when there are many rows.
How to show new line in top? Or is there another sollution?
Johan
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
New row in subform
-
- nuBuilder Team
- Posts: 506
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 8 times
- Been thanked: 18 times
Re: New row in subform
If you want to have the new line in the top you can sort the subform from the main form.
You can add to the JS on the main form the following.
(use your subform reference and column number -2nd parameter- which will be used for sorting)
You can add to the JS on the main form the following.
(use your subform reference and column number -2nd parameter- which will be used for sorting)
Code: Select all
nuSortSubform("sub_FF_parts", "5", 'asc');
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: New row in subform
Or add a button which will when clicked set the focus on the first field of the last row in the subform .
Code: Select all
function subFormFocusLastRow(subFormId, fieldId) {
var lastRow = nuSubformObject(subFormId).rows.length;
lastRow = lastRow == 1 ? lastRow : lastRow-1;
console.log(subFormId + nuPad3(lastRow) + fieldId);
$('#' + subFormId + nuPad3(lastRow) + fieldId).focus();
}
You do not have the required permissions to view the files attached to this post.