Can rows in a subform be clickable (and redirect to)

Questions related to using nuBuilder Forte.

Can rows in a subform be clickable (and redirect to)

Unread postby absalom » Mon Apr 05, 2021 2:10 am

With the help of answer in 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)?
absalom
 
Posts: 24
Joined: Sat Apr 03, 2021 11:20 pm
nuBuilder Version: 4.5

Re: Can rows in a subform be clickable (and redirect to)

Unread postby kev1n » Mon Apr 05, 2021 2:35 am

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)
kev1n
nuBuilder Team
 
Posts: 1625
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Can rows in a subform be clickable (and redirect to)

Unread postby kev1n » Mon Apr 05, 2021 2:49 am

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.
});
kev1n
nuBuilder Team
 
Posts: 1625
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to General

Who is online

Users browsing this forum: absalom, GlenMcCabe and 26 guests