function setModel($a, $b = null) { $m = parent::setModel($a, $b); if ($_GET["export_csv"] == $this->name) { /* format csv, export */ $export = $this->add("Export"); $data = $export->getDataFromMVCGrid($this); $export->setHeaderModel($a); $export->convertToCSV($data); $export->exportCSV("export.csv"); } if ($_GET["export_pdf"] == $this->name) { /* format csv, export */ $export = $this->add("Export"); $data = $export->getDataFromMVCGrid($this); $export->setHeaderModel($a); $export->convertToPDF($data); $export->exportPDF("export.pdf"); } if ($_GET["export_xls"] == $this->name) { /* format csv, export */ $export = $this->add("Export"); $data = $export->getDataFromMVCGrid($this); $export->setHeaderModel($a); $export->setConverterTemplate("export/xls"); $export->convertToXLS($data); $export->exportXLS("export.xls"); } $this->addColumn('delete', 'delete'); $this->owner->js('reload', $this->js()->reload()); return $m; }
function setModel($m) { parent::setModel($m, array('id', 'filestore_type', 'name_size')); $this->dq->order('id desc')->limit(10); }