View record Details on a Parent Page

Hi all,

As you are well aware, the core of Tadabase’s front-end involves displaying an overview view of records in a data table via a table or list component, and then adding a Details Page to view record details and connected records.

What I wanted to do was find a way to be able to view record details and connected records on a parent page. It’s a bit of a hack but it does work well when implemented correctly.

We hope to add this capability into the Tadabase platform in the future.

This is a bit advanced as far as customization goes, so hopefully the instructions make sense. Here’s a demo link for anyone interested!

https://timyoung.tadabase.io/iframe-details#!/iframe-details

How To:

  1. Create a text field in your Data Table and name it “recordId”

  1. Create a table rule that says: On Create or Edit, set {recordId} to a record value of (Record ID)

  1. Create a dynamic field and paste the following template…

<button recordId="{{your_recordID_field_ID}}" id="detailsLink" class="btn btn-outline btn-block btn-sm btn-primary td-data-link loadIntoIframe">View</button>



  1. On the parent page you wish to display record details, create a new row with an HTML component inside.

  1. Paste the following HTML into the source code of the HTML component.

<p><iframe id="my-iframe" class="taskDetails" name="detailsIframe" width="100%" height="800px" frameborder="0"></iframe></p>

  1. Paste the following CSS into the page CSS tab

     @media only screen and (min-width: 992px) {
         .taskDetails {
             color: black;
             background-color: #fff;
             height: 100vh;
             /*Sets the width of the side bar*/
             width: 400px;
             position: fixed;
             top: 0;
             /*Positions the side bar next to the Main Menu - 125px is the width of the menu*/
             right: 0px;
             z-index: 5;
             outline: none;
             overflow-y: hide;
             border-left: 2px solid #eeeeee;
         }
         .t-pagecontainer {
             margin-right: 400px;
         }
     }
    
  2. The CSS above does a few things,

  • Affixes the iframe to the right side of the screen at all times.
  • Shift the page-container for the app to the left to make room for the iframe.
  • The media query restricts this CSS to screen sizes to larger than 992px.
  1. Paste the following into the JS tab of the page
TB.render('component_3', function(data) {
  $(document).on('click', '.loadIntoIframe', function() {
    var recordId = $(this).attr('recordid');
    $('#my-iframe').attr('src', 'paste_your_URL_here' + recordId);
  });
});
  1. Create a new layout with no menu, breadcrumbs, or user menu. We want this layout to be completely blank.

  1. Create a parent + details page in the new layout for the data table you were working with in the previous steps.

  1. Preview the parent page you just created, go to the details page, and get the URL for the details page. Copy the URL without the record ID

  1. Go back to step 8 and paste in your details URL where it says “details_URL_goes_here”

  2. Get the component_id for your data component on the parent page with the iframe

  1. Go back to step 8 and replace “component_3” with your component_id from Step 13

  2. On the page that contains your iframe, make sure the dynamic field with the details link is visible in your data component.

  1. Preview the page and click the button!
4 Likes

@tim.young I am happy about plans of Tadabse to have this details field on a parent page included in the possibilities. Second this (a lot!)

3 Likes

@Chem how would you tweak the above JavaScript if you just wanted to load an HTML section as a stand alone component on the parent page?

In my use case, I don’t need the button, or the sidebar, I just need to load a persistent HTML iFrame with child data on the parent page.

Thanks!

Just don’t click the Save button in the side panel :wink:

Good call!

I just changed the Edit form’s submission rule to show a confirmation message instead of redirecting to the parent page.

Hi Tim, could you explain what this Equation field is doing? And how come it became a button? :thinking:

Sure! The equation field will actually render HTML so here we are constructing an HTML string using the CONCAT function.

So what you are saying is that the equation field is capable of rendering HTML? Any limitation on what kind of HTML string we can construct?

Thank you for posting this trick!!! I really love this idea because it looks slick and helps keep the user on the same front end web page without having to be redirected to a child page.

Has anyone had any luck modifying the button action and iframe in this scenario so that the iframe can toggle (show iframe/ hide iframe) similar to a modal? I don’t necessarily want the iframe to always be fixed to the right side of the screen. Thank you in advance!

Hi Tadabase,

I cannot use the equation:

CONCAT(‘<button’,CHAR(32),‘recordId="’,{recordId},‘"’,CHAR(32),‘id=“detailsLink”’,CHAR(32),‘class="btn’,CHAR(32),‘btn-block’,CHAR(32),‘btn-primary’,CHAR(32),‘loadIntoIframe">VIEW’)

this is not valid according to equation:

I caanot save it meaning I cannot use that particular Equation. Please help!

@edison Equation can be

CONCAT('<button recordId="', {recordId},'"  class="btn btn-block btn-primary loadIntoIframe">VIEW</button>')
2 Likes

Thank you! In my table I got RecordId, but in the equation, it’s recordId. Case sensitive. Thank you :slight_smile:

Unearthing this topic after watching the new dynamic data bridge feature. With dynamic data bridge you can easily make a details component on a list page (feature spotlight of Tim). Looks like something we have tried to easily achieve since long, but without the above tricks.

@tim.young

Is it now straightforward to display detail data on a list page (parent page) with the new dynamic data feature?

1 Like

Good point, @Peter