This topic is locked
[SOLVED]

  Detail table in master table tab.

4/10/2011 1:38:25 PM
PHPRunner General questions
J
JCRamos author

I have a master table (tests) with two tables detail (diagnostics and samples).

PHPRunner placed on the forms to add, edit and view the master table its detail tables below that.

This makes the page too much long.

The master table already has its fields in two tabs and I would add two tabs which contain the detail tables.

I tried to copy and paste with the visual editor and code editor, but has not worked.

Is it possible to do what I want?
Thanks.

G
gtettert 5/3/2011

I need to do the same thing. Did you resolve this outside the forum. If so, can you post your solution.



I have a master table (tests) with two tables detail (diagnostics and samples).

PHPRunner placed on the forms to add, edit and view the master table its detail tables below that.

This makes the page too much long.

The master table already has its fields in two tabs and I would add two tabs which contain the detail tables.

I tried to copy and paste with the visual editor and code editor, but has not worked.

Is it possible to do what I want?
Thanks.

M
mathias@mylo.be 6/22/2011

Well, I am desperately hoping that this is a feature that will be included in the next version of PHPRunner. I use it all the time, but whenever I change anything in the table, I lose my visual modifications and the detail table disappears... But this is how I do it:
You're gonna have to do a few changes in the template files, though! So open these in notepad or textedit or whatever you want. This is supposing you know how to find these template files...
On the View, Add and Edit pages, replace the following lines:

{BEGIN detail_tables}

##foreach @TABLE.arrDetailTables as @d##


By:

<TABLE ID=DetailTables>

<TBODY>

##foreach @TABLE.arrDetailTables as @d##

<TR ID=##@d g##_DetailTable_hidediv>

<TD>{BEGIN detail_tables}


And:



##endfor##

{END detail_tables}


by:

{END detail_tables}

</TD></TR>

##endfor##

</TBODY>

</TABLE>


This gives each of the detail tables its own Table Row.
Nevermind the ID I give these rows. I use them to hide detail tables based on a specific value in the table, but I'll explain that somewhere else if anyone needs it... (For instance the record has "network enabled" checkbox checked, and you get a detail table "IP addresses".
Now go back to your PHPRunner Visual Editor, and there, simply cut the code in HTML view of the table containing the detail tables, and paste it in the tab of your choice. Then leave out the rows that you don't want to see there.

Paste the same code in any other tab you want and each time leave out the rows that shouldn't be on that tab, leaving only the detail tables you want.
Regards,

Mylo

J
JCRamos author 6/23/2011

Thank you very much. I am eternally grateful.

I already tried your solution and it works perfectly. Complicated but elegant.

Even the save button works correctly and saves the data as the main table as the detail tables.

I also hope that the next version of PHPRunner contains a visual editor that supports these changes.