/** * Default / simple DataBinder for this Meta DataGrid. This can easily be overridden * by calling SetDataBinder() on this DataGrid with another DataBinder of your choice. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). */ public function MetaDataBinder() { // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = Category::CountAll(); } // Setup the $objClauses Array $objClauses = array(); // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from Category, given the clauses above $this->DataSource = Category::LoadAll($objClauses); }
protected function dtgCategory_Bind() { $objExpansionMap[Category::ExpandCreatedByObject] = true; // Get Total Count b/c of Pagination $this->dtgCategory->TotalItemCount = Category::CountAll(); if ($this->dtgCategory->TotalItemCount == 0) { $this->dtgCategory->ShowHeader = false; } else { /* $objClauses = array(); if ($objClause = $this->dtgCategory->OrderByClause) array_push($objClauses, $objClause); if ($objClause = $this->dtgCategory->LimitClause) array_push($objClauses, $objClause); if ($objClause = QQ::Expand(QQN::Category()->CreatedByObject)) array_push($objClauses, $objClause); $this->dtgCategory->DataSource = Category::LoadAll($objClauses); $this->dtgCategory->ShowHeader = true;*/ $this->dtgCategory->DataSource = Category::LoadAllWithCustomFieldsHelper($this->dtgCategory->SortInfo, $this->dtgCategory->LimitInfo, $objExpansionMap); $this->dtgCategory->ShowHeader = true; } }
public function dtgCategory_Bind() { // Get Total Count b/c of Pagination $this->dtgCategory->TotalItemCount = Category::CountAll(); $objClauses = array(); if ($objClause = $this->dtgCategory->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgCategory->LimitClause) { array_push($objClauses, $objClause); } $this->dtgCategory->DataSource = Category::LoadAll($objClauses); }
protected function dtgCategory_Bind() { // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll() // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below $this->dtgCategory->TotalItemCount = Category::CountAll(); // Setup the $objClauses Array $objClauses = array(); // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->dtgCategory->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgCategory->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all Category objects, given the clauses above $this->dtgCategory->DataSource = Category::LoadAll($objClauses); }