Inheritance: extends QPaginatedControl
 /**
  * QDataGrid::__construct()
  *
  * @param mixed  $objParentObject The Datagrid's parent
  * @param string $strControlId    Control ID
  *
  * @throws QCallerException
  * @return \QDataGrid
  */
 public function __construct($objParentObject, $strControlId = null)
 {
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->CssClass = 'datagrid';
 }
Example #2
0
 public function __construct($objParentObject, $strControlId = null)
 {
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // For example... let's default the CssClass to datagrid
     $this->strCssClass = 'datagrid';
 }
Example #3
0
 public function __construct($objParentObject, $strControlId = null)
 {
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // For example... Let's ensure that any LINKED header is still Black
     $this->objHeaderLinkStyle->ForeColor = "black";
 }
Example #4
0
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case "ShowColumnToggle":
             try {
                 $this->blnShowColumnToggle = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ShowCheckboxes":
             try {
                 $this->blnShowCheckboxes = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ShowExportCsv":
             try {
                 $this->blnShowExportCsv = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ExportCsv":
             try {
                 $this->blnExportCsv = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "blnModified":
             try {
                 $this->blnModified = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 protected function GetDataGridRowHtml($objObject)
 {
     // Get the Default Style
     $objStyle = $this->objRowStyle;
     // Iterate through the Columns
     $strColumnsHtml = '';
     foreach ($this->objColumnArray as $objColumn) {
         try {
             $strHtml = $this->ParseColumnHtml($objColumn, $objObject);
             if ($objColumn->HtmlEntities) {
                 $strHtml = QApplication::HtmlEntities($strHtml);
             }
             // For IE
             if (QApplication::IsBrowser(QBrowserType::InternetExplorer) && $strHtml == '') {
                 $strHtml = ' ';
             }
         } catch (QCallerException $objExc) {
             $objExc->IncrementOffset();
             throw $objExc;
         }
         $strColumnsHtml .= sprintf("    <td %s>%s</td>\r\n", $objColumn->GetAttributes(), $strHtml);
     }
     // Apply AlternateRowStyle (if applicable)
     if ($this->intCurrentRowIndex % 2 == 1) {
         $objStyle = $objStyle->ApplyOverride($this->objAlternateRowStyle);
     }
     // Apply any Style Override (if applicable)
     if (is_array($this->objOverrideRowStyleArray) && array_key_exists($this->intCurrentRowIndex, $this->objOverrideRowStyleArray) && !is_null($this->objOverrideRowStyleArray[$this->intCurrentRowIndex])) {
         $objStyle = $objStyle->ApplyOverride($this->objOverrideRowStyleArray[$this->intCurrentRowIndex]);
     }
     // Make the event string
     $strTrId = sprintf("%srow%s", $this->strControlId, $this->intCurrentRowIndex);
     $numEvents = count($this->objRowEventArray);
     if ($numEvents > 0) {
         $this->RemoveChildControl($strTrId, true);
         $objRow = new QDataGridRow($this, $strTrId);
         // add all the row actions to this proxy
         for ($i = 0; $i < $numEvents; ++$i) {
             $objRow->AddAction($this->objRowEventArray[$i], $this->objRowActionArray[$i]);
         }
         $objRow->Style = $objStyle;
         // parse the action parameter
         $objRow->ActionParameter = QDataGridBase::ParseHtml($this->strRowActionParameterHtml, $this, null, $objObject);
         $strToReturn = $objRow->GetHtml($strColumnsHtml);
         QApplication::ExecuteJavaScript($objRow->GetActionAttributes());
     } else {
         // If there are no events, don't create any row controls'
         // Finish up
         $strToReturn = sprintf('<tr id="%s" %s>%s</tr>', $strTrId, $objStyle->GetAttributes(), $strColumnsHtml);
     }
     $this->intCurrentRowIndex++;
     return $strToReturn;
 }