Customizing the way the list is rendered

Archived from the Xataface Users forum.

chichi — Mon Sep 06, 2010 10:32 am

Hello, dont delete this I just have a question and clicked delete by incident.

In the documentation I found the info for customizing the way the list is rendered.

I have a table called “customers”

Code: Select all
`class tables_customers {

    function renderRow( &$record ){
        return ‘<td>’.$record->display(‘name’).’</td>’.
               ’<td>’.$record->display(‘lastname’).’</td>’.
               ’<td>’.$record->display(‘online’).’</td>’;
    }`

Result: It shows me the data the way I want it.
How can I change the output name to have a link to the EDIT-URL of the record.

I tested:
‘<td>’.$record->display(‘name’).’</td>’.

chichi


cantlep — Tue Sep 07, 2010 1:10 am

might this work?

Code: Select all
<td><a href="index.php?-table=customers&-action=edit&-record=customers?'.$record->strval('name').'">'.$record->display('name').'</a></td>'.

I’m not 100%, it’s just a guess.


shannah — Fri Sep 17, 2010 12:25 pm

You can get the edit url for a record using the getURL() method:

Code: Select all
$record->getURL('-action=edit')