Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented ability to specify "Default" sort direction on a column f…

…or QDataGrid and QDataGridColumn
  • Loading branch information...
commit 495840bfa979d9b6cf0fe1a5a4e2e598de6fce15 1 parent c171530
@mikeho mikeho authored
View
2  includes/qcodo/_core/qform/QDataGridBase.class.php
@@ -456,7 +456,7 @@ public function Sort_Click($strFormId, $strControlId, $strParameter) {
} else {
// Nope -- so let's set it to this column
$this->intSortColumnIndex = $intColumnIndex;
- $this->intSortDirection = 0;
+ $this->intSortDirection = $objColumn->DefaultSortDirection;
}
} else {
// It isn't -- clear all sort properties
View
11 includes/qcodo/_core/qform/QDataGridColumn.class.php
@@ -37,6 +37,7 @@ class QDataGridColumn extends QBaseClass {
protected $strName;
protected $strHtml;
protected $blnHtmlEntities = true;
+ protected $intDefaultSortDirection = 0;
public function __construct($strName, $strHtml = null, $objOverrideParameters = null) {
$this->strName = $strName;
@@ -175,6 +176,7 @@ public function __get($strName) {
// MANUAL QUERY BEHAVIORS
case "SortByCommand": return $this->objOrderByClause;
case "ReverseSortByCommand": return $this->objReverseOrderByClause;
+ case "DefaultSortDirection": return $this->intDefaultSortDirection;
// MISC
case "Html": return $this->strHtml;
@@ -371,8 +373,13 @@ public function __set($strName, $mixValue) {
$objExc->IncrementOffset();
throw $objExc;
}
-
-
+ case "DefaultSortDirection":
+ if ($mixValue == 1)
+ $this->intDefaultSortDirection = 1;
+ else
+ $this->intDefaultSortDirection = 0;
+ break;
+
// MISC
case "Html":
try {
Please sign in to comment.
Something went wrong with that request. Please try again.