Change Table From Regular Table To Detail Table

Hi,

I have a table that is a regular absolute positioned table. Using another script this table gets populated as if it was a detail table. What I want to do is use the same table but instead make it a detail table by changing the tables attributes. Below code using the table ID does change the attribute to detail. I know this because when I select the table in design mode the tables attribute “Detail Table” is set to none and when I select preview mode the attribute is set to the detail table that I want. However the table only shows the first line of the data and not the rest. Is there any other attributes that I need to configure?

query(‘#D51table’).attr(‘id’,‘D51table’);
query(‘#D51table’).attr(‘class’,‘D51TableClass’);
query(‘#D51table’).attr(‘data-column-resize’,‘True’);
query(‘#D51table’).attr(‘data-hide-when-empty’,‘True’);
query(‘#D51table’).attr(‘data-detail’,‘D51table’);

EDIT: This is what I get from the logger:

INFO [22 Feb 2018 09:19:24,295][main] com.objectiflune.scripting.engine.OLErrorReporter.processLogMessage(OLErrorReporter.java:?)[SOURCE=New Script - Line 6]
<table id=“D51table” class=“D51TableClass” data-column-resize=“True” data-hide-when-empty=“True” data-detail=“D51table” anchor=“page_media_0”
style=“width: 415px; position: absolute; top: -84.26670000000001px; text-align: left; margin-left: auto; margin-right: auto; page-break-after: avoid; left: -4.266670000000001px; height: 10px;” title=“D51table” offset-x=“18.416662443237303” offset-y=“206.73329999999999”>
<tbody>
<tr data-repeat=“”>
<td class=“data Service” style=“width: 8.43%; text-align: center;”>@serv@</td>
<td class=“data MeterNumber” style=“width: 13.01%; text-align: center;”>@meter@</td>
<td class=“data PreviousReading” style=“width: 17.83%; text-align: center;”>@previous@</td>
<td class=“data PresentReading” style=“width: 16.39%; text-align: center;”>@present@</td>
<td class=“data Consumption” style=“width: 14.22%; text-align: center;”>@consump@</td>
<td class=“data Period” style=“width: 15.18%; text-align: center;”>@period@</td>
<td class=“data DailyAverage” style=“width: 14.94%; text-align: center;”>@average@</td>
</tr>
</tbody>
</table>

Regards,

S

This is an order of operations issue. By the time you’re running this script to make this table a detail table, the programming that actually makes detail tables (internal script, not visible) has already run.

If you’re going to go this route, I think you’re going to have to manually create the table through your script. There’s an example of how to do this via cloning here: https://learn.objectiflune.com/fr-fr/planetpress-connect/howto/cloning-your-way-through-nested-tables

Hi AlbertsN,

Thanks for the info. If that is the case then I might as while just stick to the one clone script I already have. This exercise was merely to see if it would give a performance boost.

Regards,

S