IncrementOffset(); throw $objExc; } // Record Method Callbacks $this->strSetEditPanelMethod = $strSetEditPanelMethod; $this->strCloseEditPanelMethod = $strCloseEditPanelMethod; // Setup the Template $this->Template = 'JavaScriptListPanel.tpl.php'; // Instantiate the Meta DataGrid $this->dtgJavaScripts = new JavaScriptDataGrid($this); // Style the DataGrid (if desired) $this->dtgJavaScripts->CssClass = 'datagrid'; $this->dtgJavaScripts->AlternateRowStyle->CssClass = 'alternate'; // Add Pagination (if desired) $this->dtgJavaScripts->Paginator = new QPaginator($this->dtgJavaScripts); $this->dtgJavaScripts->ItemsPerPage = 8; // Use the MetaDataGrid functionality to add Columns for this datagrid // Create an Edit Column $this->pxyEdit = new QControlProxy($this); $this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click')); $this->dtgJavaScripts->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit'); // Create the Other Columns (note that you can use strings for java_script's properties, or you // can traverse down QQN::java_script() to display fields that are down the hierarchy) $this->dtgJavaScripts->MetaAddColumn('Id'); $this->dtgJavaScripts->MetaAddColumn('Name'); $this->dtgJavaScripts->MetaAddColumn('Description'); $this->dtgJavaScripts->MetaAddColumn('Filename'); // Setup the Create New button $this->btnCreateNew = new QButton($this); $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('JavaScript'); $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click')); } public function pxyEdit_Click($strFormId, $strControlId, $strParameter) { $strParameterArray = explode(',', $strParameter); $objEditPanel = new JavaScriptEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]); $strMethodName = $this->strSetEditPanelMethod; $this->objForm->$strMethodName($objEditPanel); } public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) { $objEditPanel = new JavaScriptEditPanel($this, $this->strCloseEditPanelMethod, null); $strMethodName = $this->strSetEditPanelMethod; $this->objForm->$strMethodName($objEditPanel); } } ?>