HI again!
I have the code above at the Qdatagridbase.class.php
and I add also this to the constructor of this class:
//csv
$this->btnCsvDownload = new QImageButton($this);
$this->btnCsvDownload->ImageUrl = 'assets/images/ver_xls.gif';
$this->btnCsvDownload->CssClass = 'activeIcon';
$this->btnCsvDownload->AddAction(new QClickEvent(), new QServerControlAction($this,'lnkDownload_Click'));
But, when I click on that button, it gives me the csv but with the following error:
Control cannot be rendered until RenderBegin() has been called on the form.
Exception Type: QCallerException
Rendered Page: Click here to view contents able to be rendered
Source File: g:\xampp\xampp\htdocs\mediweb\sam\includes\data_classes\Common.class.php Line: 889
Line 884: } else{
Line 885: return '<input type="checkbox" disabled>'.$chkSelected->Enabled=false;
Line 886: }
Line 887:
Line 888: } else {
Line 889: return $chkSelected->Render(false);
Line 890: }
Line 891: }
Line 892:
Line 893:
It seems that I get this error cause I have this function that allow me to check a user to edit it...
public static function chkSelected_Render($objParentObject,$blnEditMode,$Idobj, $dtgBind,$Idedited = null) {
$strControlId = 'chkSelected' . $Idobj;
// Let's see if the Checkbox exists already
$chkSelected = $objParentObject->GetControl($strControlId);
if (!$chkSelected) {
$chkSelected = new QCheckBox($dtgBind, $strControlId);
$chkSelected->AddAction(new QClickEvent(), new QJavaScriptAction('isChecked(this.checked);'));
}
if($blnEditMode)
{
if ($Idedited == $Idobj)
{
return '<img src="assets/images/checked_out.png" border="0">'.$chkSelected->Visible=false;
} else{
return '<input type="checkbox" disabled>'.$chkSelected->Enabled=false;
}
} else {
return $chkSelected->Render(false);
}
}
Any Ideas on how to solve it?
Thanks