Page 1 of 1

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

Posted: Sun Apr 04, 2021 6:40 pm
by absalom
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)?

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

Posted: Sun Apr 04, 2021 7:05 pm
by kev1n
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)

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

Posted: Sun Apr 04, 2021 7:19 pm
by kev1n
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.
});