Moved all grid elements onto the grid helper. Basic testing done, but more testing needs to be done.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@262 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -13,7 +13,10 @@ class GridHelper extends AppHelper {
|
||||
|
||||
function reset() {
|
||||
$this->jqGrid_options
|
||||
= array('limit' => 20);
|
||||
= array('limit' => 20,
|
||||
'search_fields' => array(),
|
||||
'custom_post_data' => array(),
|
||||
);
|
||||
|
||||
$this->columns = array();
|
||||
$this->included = array();
|
||||
@@ -71,8 +74,10 @@ class GridHelper extends AppHelper {
|
||||
return $this;
|
||||
}
|
||||
|
||||
function sortField($field) {
|
||||
function sortField($field, $order = null) {
|
||||
$this->jqGrid_options['sort_column'] = $field;
|
||||
if ($order)
|
||||
$this->jqGrid_options['sort_order'] = $order;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -149,6 +154,12 @@ class GridHelper extends AppHelper {
|
||||
elseif (is_bool($excluded) && !$excluded)
|
||||
$excluded = array();
|
||||
|
||||
// Tack on any config include/exclude requests
|
||||
if (isset($config['include']))
|
||||
$included = array_merge($included, $config['include']);
|
||||
if (isset($config['exclude']))
|
||||
$excluded = array_merge($excluded, $config['exclude']);
|
||||
|
||||
// Calculate the actual inclusion set
|
||||
$included = array_diff(array_merge($this->included, $included),
|
||||
array_merge($this->invalid, $excluded));
|
||||
|
||||
Reference in New Issue
Block a user