Forums

DB Multi Loader Display Data feature

apryl 04 Nov, 2011
Hi,
I have followed the DB Multi Record loader tutorial and have made a listing of records that can be edited using a custom code action to add the edit link.
I really like the way the "Data Displayer" feature works in the DB Multi Record Loader Action and how you can sort by each field, but I cannot find a way to use that and have the Edit link. It only displays the record with no way to edit, because you can only define fields to be displayed.
When I try to add Headers to the custom code they appear above each record instead of once at the top of the table.
Can anybody help me to use the Data Display feature and maybe include a field that will give me an "edit" link?
I don't mind using the custom code, but I would really like for my table to have headers and to make the records sortable and can't find a way to do that.

Thank you in advance,
Apryl
GreyHead 04 Nov, 2011
Hi Apryl,

I haven't tried this but I think I'd expect to have it work in much the same way as in ChronoConnectivity.

a) I'd put the Header & Footer of your table in separate Custom Code elements so that just the current <tr> is shown by the DB Multi_Record Loader.

b) I'd put the Edit link as separate <td> in the record <tr> with a URL that links to an edit form and identifies the current record by it's id.

Bob
apryl 06 Nov, 2011
Thanks Bob,
I didn't even think of using a separate Custom code Action for the table header. That worked great! I made the headings links with &order and &direction so now they are sortable. 😀
pd9 07 Nov, 2011
I'm curious what you actually implemented. Were you able to continue using the data displayer, or did you have to code the columns heading with the sorting and direction?
apryl 09 Nov, 2011
I only used the Data Display feature to see how the column headings were coded and then I manually added them myself to a custom code action and turned the data display feature off. 😀
DECHAUD Patrice 10 Nov, 2011
Hi Apryl.

I'm really interested by your solution to sort data but don't find the way to do it...

Can you explain me with some screenshots please ?

For example i don't find the place to type "&order" and where deactivate Display...

Thank you very much in advance.
apryl 10 Nov, 2011
Hi Dechaud Patrice,
I followed the Tutorial and then added two custom code actions actions below the DB Multi Load action.
The first custom code was for the table heading, and the second is for the table body.
I didn't need to sort all the columns and only need to sort by member number or last name, so I only have two links in my column heading and left the others blank.
Table head:
<table width="480" border="0" cellspacing="0" cellpadding="4">
<thead>
<tr><th class="col1 cell"><a class="order_link" href="http://website.com/index.php?option=com_chronoforms&view=form&Itemid=175&order=memno&direction=asc">Sort by Member No.</a></th><th class="col2 cell"><a class="order_link" href="http://website.com/index.php?option=com_chronoforms&view=form&Itemid=175&order=hoh_last&direction=asc">Sort by HOH1 Last Name</a></th><th></th><th></th></tr></thead>


Table body:
<table width=480>
<?php
foreach($form->data['Members'] as $detail):
?>
<tr>
<td>#<?php echo $detail['memno']; ?></td>
<td><?php echo $detail['hoh_last']; ?>, <?php echo $detail['hoh_first']; ?></td>
<td><?php echo $detail['hoh2_last']; ?>, <?php echo $detail['hoh2_first']; ?></td>
<td><a href="index.php?option=com_chronoforms&chronoform=adminProfiles&token=<?php echo $detail['memno']; ?>">Edit</a></td>
</tr>
<?php
endforeach
?>
</table>

[attachment=0]sschronoLister.jpg[/attachment]
There may be a better way to do this, but this is what worked for me.
Hope it helps,
Apryl
DECHAUD Patrice 10 Nov, 2011
Thank you very much for this very fast answer !

It seem's to me most clearly now.

I will try it and post you the result.

Regards from France with a poor sunbeam today...

Patrice.
This topic is locked and no more replies can be posted.