Page 1 of 1

Customizing the way the list is rendered

PostPosted: Mon Sep 06, 2010 10:32 am
by chichi
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><a href="???">'.$record->display('name').'</a></td>'.


chichi

Re: Customizing the way the list is rendered

PostPosted: Tue Sep 07, 2010 1:10 am
by cantlep
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.

Re: Customizing the way the list is rendered

PostPosted: Fri Sep 17, 2010 12:25 pm
by shannah
You can get the edit url for a record using the getURL() method:
Code: Select all
$record->getURL('-action=edit')