I’m trying to create a custom table that has 3 main characteristics:
Fully responsive, collapsing down to a block view on mobile
Every row is clickable through to the details page
Details page opens in a popup modal
So far, I have been able to accomplish 1 and 2, but I seem to be stuck on 3. I am able to create a clickable row, and I’m able to create a details popup, but have yet been able to combine them.
Resources:
In theory, it should be possible. Bootstrap 3.3.7 does have the ability to create custom modal popups
There are pluses and minuses to using actual tables <tr><td> structure vs <div> style grid. The benefit to using a Bootstrap grid is that you can wrap an entire row in an <a href=""> tag and make it clickable without JavaScript:
I’ll get this conversation going by first addressing the link tag.
For opening a link in a popup, you can set “a” tag like below. Keep in mind, you can’t put href tag inside a table row, so you’d have to keep tweaking your code’s CSS.
Make sure to set the Page ID of the page you wish to open. You can find the child page ID in the URL in the builder:
If you’re working with connected records, for example, if each of these records connects to a ‘parent’ record, we can open a child page that belongs to records from this table. I’ll clarify. Suppose you’re showing a list of jobs and each of these jobs are assigned to a user. If you have another page in the app that shows details about each user, we can open that page as well. It’s a bit tricky though.
First, find the ID of that page. Then we have to loop through the connection field incase there is more than one record. In my case, the ID is: L5MjKxr0kq
{{#each obj.field_38}}
<a href='{{tb_link this}}' class="tb-link-action-click tb-link-in-popup" data-tb-page-id="L5MjKxr0kq" data-tb-rid={{@key}} data-tb-page-title="Editing the employee this job belongs to">
{{this}}
</a>
{{/each}}
@moe Thanks for the response! The first option worked perfectly, and I’ll work on implementing the 2nd one next.
I also wanted to share a use case for the popup to connected page that may make more sense. For this example I created a basic CRM with Deals, Contacts, and Companies.
The challenge I have faced is that Detail, Edit, and Add pages are tied to the table they are created with. As I have built out our app, I will complete a table and associated pages only to realize that it makes much more sense to design the element as a list or a custom object instead of the original table.
However, swapping out that table for a list becomes quite complicated:
I need to not only delete the old table, but also all of the corresponding Add, Delete, and Edit pages along with it
Lists and custom components don’t have an “Add” option, and there isn’t really a solid workaround other than using an action button to create a blank record (which is kinda confusing for users)
I currently have 21 pages cascading off of a single table that I no longer use, and I don’t know what to do with them.
My goal would be to have a single Add, Edit and Detail page to reference for each “Object” (Deals, Contacts, Companies).
The idea is that you would still be opening the record related to whatever page you are currently on, but you would only have to maintain a single page for each object in your app.
Hey @james I need something similar for my project. I’ve got a basic custom list component working but I’d like to get a modal editing enabled. Please post any progress updates if you can a chance it would be greatly appreciated.