MetaAddColumn and Fuction Call
Hi,
After all the problems I had yesterday I could create the forms I needed it. Today I'm working with one metadatagrid control.
In my table I have one numeric field to define the profile of one user. When I show the data in the metadatagrid everything goes fine if I show the values like they are. But I want to show to the user the name of the profiles instead of the numeric values. I could did it in simple datagrids using a function to evalue the data ans print the profile.
Now, with metadatagrids I'm having an error, the error message is this:
Fatal error: Call to undefined function DisplayFullName() in C:\AppServ\www\qcubed-1.1.0\1.1.0\includes\metadatagrid.php
I have created the funstion but I think I'm making a mistake calling it, this is my code:
$this->dtgNivell->MetaAddColumn('Usuari'); //this field shows the value in the field "Usuari" at the table
$this->dtgNivell->MetaAddColumn('Contrasenya'); //this field shows the value in the field "Contrasenya" at the table
$this->dtgNivell->MetaAddColumn(DisplayFullName('Nivell')); //here I call the function passing the value of the field "Nivell" to be evaluated.
.
.
.
public function DisplayFullName($Nivel) {
if (Nivel == 0){
$strToReturn = sprintf('%s', 'Usuer');
}
if (Nivel == 1){
$strToReturn = sprintf('%s', 'Administrator');
}
return $strToReturn;
}
------------------------------------------------------------------------------
Can anybody tell me how to make the correct function calling, or which is my mistake?

You shouldn't be using MetaAddColumn, but rather creating a new column yourself, and using '<? $_FORM->DisplayFullName($_ITEM); ?>' as the HTML for it.
Or just override the Html property of the column by ->MetaAddColumn('Nivel', array(Html=>'<? $_FORM->DisplayFullName($_ITEM); ?>'))
it's working akrohn, thank you so much