PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Using Structures_DataGrid_Column::setFormatter

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Structures
View previous topic :: View next topic  
Author Message
rhysjo



Joined: 26 Dec 2006
Posts: 1

PostPosted: Tue Dec 26, 2006 8:15 pm    Post subject: Using Structures_DataGrid_Column::setFormatter Reply with quote

I am able to get the examples for the DataGrid library to work just fine. However, once I try to embed the examples into a custom class I can't seem to get the callback functionality in Structures_DataGrid_Column::setFormatter() to work correctly.

Code:


class CustomClass(){
.
.
.
function printLastName($params)
{
              extract($params);
              return $record['lname'] ;
}
.
.
.
$this->datagrid->bind('SELECT * FROM tblUsers', $this->options);

// Define columns
$this->datagrid->addColumn(new Structures_DataGrid_Column('Last Name', null, 'Lname', null, 'n/a', $this->printLastName()));



The error I get is ...

Warning: Missing argument 1 for printlastname()
Warning: extract(): First argument should be an array

I just can't seem to get the callback to work correctly. I assume it's just a syntax issue since it works just fine with regular functions outside of a class. Thanks in advance for any help it is much appreciated.

Thanks!
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sun Jan 07, 2007 6:48 pm    Post subject: Reply with quote

For the archives (and people interested in this topic): I have answered this question on the codewalkers.com forum.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Structures All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software