i'm trying to export a grid i create with the object MVCgrid.
I found out that i can add the the current page the object 'MVCGrid_Export' instead of the object 'MVCGrid'that provides the export buttons and functionalities.
By the way i got an error during the export :
"Fatal error: Call to a member function getField() on a non-object in ..\agiletoolkit\atk4-addons\misc\lib\Export.php on line 42"
At that line, "$b[] = $this->__getHeaderModel()->getField($a)->caption();", i discovered that the result of "$this->_getHeaderModel()" is a string of the model i want to export, and not the object of that model , that is the item i need.
This is the code of my page:
class page_resultsShow extends Page {
function initMainPage() {
$p = $this;
$gr = $this->add('MVCGrid_Export');
$gr->setModel('results',array('name','budget','bestapplicants'));
$gr->addColumnMVC('name');
$gr->addFormatter('name','link');
$gr->addQuickSearch(array('name'));
$gr->addPaginator(20);
}
//details...
function page_details() {
... some code..
}
function defaultTemplate(){
return array('page/results');
}
}
I suppose i need to add some informations to explain to the grid the model that is handling , but i didn't find how!!
Thank you for the help