List join - Table template

jo-ka

Member
Hello.

I've made a list join between 2 tables, with table template. This 2 lists are also joined with an header table and is configured as repeatable, so in fact I have a first table, joined with this two.

But, I would like to have the fields of the second joined list, in the same line as the first list, and not at the bottom.

Is there a way to achive this?

Thanks in advance.

upload_2021-2-9_11-23-57.png
 
Do you want the 2nd repeat group (production...) in table layout (set it in group settings) beside the documents group?
This can be done via CSS.
 
Do you want the 2nd repeat group (production...) in table layout (set it in group settings) beside the documents group?
This can be done via CSS.

Dear Troester,

Sorry if I didn't explain correctly.
What I would like to achieve is to put the production_details... fields, right after the documentsbodys fields, on the same table,

Something like:

Session | Shift | Terminal | ... [all remainig fields from the documentsbodys table] ... | SalesDocumentDetail | Guid | Machine.

Like a regular SQL query with joins...

Hope I've been more a bit clear now. ;):p

Thanks in advance.
 
If it is only for display, you can create a View from your SQL query in the database and use that as the source for your list
 
I assume the first screenshot is from details view. I think the easiest way to achieve this would be to embed the list with the content plugin and hide the current groups. You can remove the buttons, search and other options in the list settings or with css as you like.
 
Last edited:
If it is only for display, you can create a View from your SQL query in the database and use that as the source for your list

Thanks Nagtegaal,
Yes, at first I've also thought about that but, I will also need to change data when in edit mode.

So, for this example, a view is not a solution.
Thanks mate.
 
I assume the first screenshot is from details view.

Right juuser, but I would like to have it also in edit mode...

I think the easiest way to achieve this would be to add the list to the details view with the content plugin and hide the current groups.

Wow, never tried this...
Can you please elaborate a little bit?

Thanks in advance.
 
I've tried to play around with juuser suggestion, but I wasn't capable of. Sorry If I'm being dumb, but when using the content plugin, what I get is a list inside a form, but I need to be able to edit the fields also.

So, here's what I need.

Any help?
upload_2021-2-11_16-56-44.png
 
Ok, I didn't fully understand what exacly was your goal, but now it seems more clear.

Can't you just combine these two repeat groups into one? That means have only one group (add second repeat group elements to the first one).
 
Thanks juuser, we are close.

I've been able to put the fields on the other group, but if I move the fields there, there's no data on the fields.
Any clue?

upload_2021-2-11_19-40-3.png



If I move them back to the original group, the data is there...




upload_2021-2-11_19-43-0.png
 
If you move the second group elements to the first group, there cannot be any data for the moved elements. You have to re-edit the records manually or if there are a lot of rows, copy the data with a sql query in PhpMyAdmin.
 
If you move the second group elements to the first group, there cannot be any data for the moved elements. You have to re-edit the records manually or if there are a lot of rows, copy the data with a sql query in PhpMyAdmin.

Well, I really can't do that. This is because the database tables are from an external application.
So, If do it like you suggest, I'll not have the data on the correct table on the other side.

Any other suggestion?
 
Can't you just combine these two repeat groups into one?
Every repeat group has its own table (either you joined existing database tables or Fabrik created ..._repeat_... ones). So moving an element from one repeat group to an other will create an additional (new) column in the target table (and it won't copy any data).
If you can setup your structure with all elements in one database table then you'll have what you want with only one repeat group (but you have to copy the data as @juuser says).

If you must keep two different tables I can only think of @juuser's content plugin solution.
Create a list which is joining the two tables you have in the repeat groups.
Include this list via content plugin in the form outro (group outro won't do because you can't have nested form tags) with ajaxfied links and filtered with the form's rowid
Then the user can add and edit this list's records.
 
OK, I'll give this a try.
I understood the repeat tables concept, as I understand I can't use the plugin on groups. Perfect, I'll try it in the form.

I'm just not sure if I understood this part, [QUOTE="with ajaxfied links and filtered with the form's rowid[/QUOTE], but I'll make my trials.

Thank's for your patience guys.
 
ajaxfied links: in list settings/Links set it to YES, then the user will get the form of this list in a popup

filtered with the form's rowid: something like {fabrik view=list listid=x your-parent-id-element=[rowid]}
 
OK, I might be getting close...

I have 3 more questions:

1 - When using the filter {fabrik view=list listid=x your-parent-id-element=[rowid]}, I need something more specific. This is:

The DocumentsHeaders table is linked to DocumentsBodys table by a Guid field. This is:

On DocumentsHeaders the field is Guid. On DocumentsBodys the field is DocumentGuid. I've tried the filter like this:

{fabrik view=list listid=x documentsbodys___DocumentGuid = documentsheaders___Guid}, but it doesn't work, even with _raw appended.. When I force:

{fabrik view=list listid=x documentsbodys___DocumentGuid = 598a8e16-5f4b-4821-b8d6-b5ce900793ec}, it filters the table correctly.

How shall I build this filter?

2 - To remove the list box from the display, I need to create a template? Or shall I use CSS? In this case, where?

3 - Finally, I get this result when in view mode, not on edit mode. Is this correct? Or can I add the same list plugin elsewhere, to have the lines displayed on edit mode also?

Thanks my friends.



upload_2021-2-12_11-34-42.png
 
documentsbodys___DocumentGuid =[documentsheaders___Guid] (or maybe _raw)

This List select is only in the backend. You can disable it for this list in list settings/Navigation.

I'm a bit astonished that the content plugin is working in the backend at all...
Is this all for working in the backend?
I get this result when in view mode, not on edit mode
Should be in both if you set "Process Joomla plugins" for both in form settings/Options

BTW: I would set list "Empty" access to nobody.
 
Well, I've got some progress...

documentsbodys___DocumentGuid =[documentsheaders___Guid] (or maybe _raw)

I can't get this working, even with _raw option. What can I be doing wrong?

This List select is only in the backend. You can disable it for this list in list settings/Navigation.

Perfect, it works. Awesome.

I'm a bit astonished that the content plugin is working in the backend at all...
Is this all for working in the backend?

Well, it works. The idea is to be used on frontend, but if it works on backend, it's kind a bonus... :D:D:p

Should be in both if you set "Process Joomla plugins" for both in form settings/Options

Perfect, it works. Also Awesome.

BTW: I would set list "Empty" access to nobody.

Yes, right. I'm in de development stage yet, but for sure it will be disabled to common users. Anyway, Is there a way to have it set up to nobody? I just have this options when trying to set the permissions:
I use to set it up to Special...
upload_2021-2-12_14-28-17.png

- So, now I'm just stuck with the filter issue... Any ideia of what I might be doing wrong?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top