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.
Can rows in a subform be clickable (and redirect to)
-
- Posts: 25
- Joined: Sat Apr 03, 2021 3:50 pm
Can rows in a subform be clickable (and redirect to)
With the help of answer in https://forums.nubuilder.cloud/viewtopic.php?f=19&t=10945 , I could display a subform in an edit form (idea being: seeing recent orders when editing a customer); subform being displayed as a "grid". Would it be easy to make the rows clickable and redirect to another form (based on order id)?
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: Can rows in a subform be clickable (and redirect to)
How about adding a Button in each row instead?
Similar to what is shown in the Objects Demo
(Select the tab Subform on the left)
Similar to what is shown in the Objects Demo
(Select the tab Subform on the left)
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: Can rows in a subform be clickable (and redirect to)
To make the rows clickable, you'd have to add click events to each field of the grid.
Code: Select all
$("[data-nu-form=YourSubformObjectID]").click(function(){
var id = event.target.parentNode.id;
var pk = $('#' + String(id)).attr('data-nu-primary-key');
nuPopup('605f5c9cd9e8b68', pk, ''); // <-- replace 605f5c9cd9e8b68 with ID of your Orders Form.
});