Minor tweak to the css to create a margin for each grid, and so added a div to wrap each item listing. Changed the search boxes to only be available for the overall item listing.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@124 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-14 23:54:48 +00:00
parent b02695631e
commit 352e3487cc
6 changed files with 49 additions and 18 deletions

View File

@@ -23,7 +23,8 @@ if (isset($contacts)) {
$contacts), $contacts),
'limit' => 5); 'limit' => 5);
} }
else {
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name')); $jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
}
echo $this->element('jqGrid', $jqGrid_options); echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -22,7 +22,8 @@ if (isset($customers)) {
$customers), $customers),
'limit' => 5); 'limit' => 5);
} }
else {
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name')); $jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
}
echo $this->element('jqGrid', $jqGrid_options); echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -9,13 +9,13 @@ if (!isset($limit))
if (!isset($limitOptions)) { if (!isset($limitOptions)) {
$limitOptions = array(); $limitOptions = array();
if ($limit < 10) if ($limit < 10)
$limitOptions += array(2, 5); array_push($limitOptions, 2, 5);
if ($limit < 30) if ($limit < 30)
$limitOptions += array(10, 25); array_push($limitOptions, 10, 25);
if ($limit > 10) if ($limit > 10)
$limitOptions += array(50, 200); array_push($limitOptions, 50, 200);
if ($limit > 20) if ($limit > 20)
$limitOptions += array(500); array_push($limitOptions, 500);
} }
if (!isset($height)) if (!isset($height))
@@ -24,8 +24,15 @@ if (!isset($height))
if (!isset($controller)) if (!isset($controller))
$controller = $this->params['controller']; $controller = $this->params['controller'];
if (!isset($grid_div_class))
$grid_div_class = '';
$grid_div_class = 'item grid list' . ($grid_div_class ? ' '.$grid_div_class : '');
if (!isset($grid_div_id))
$grid_div_id = $controller . '-list';
if (!isset($grid_id)) if (!isset($grid_id))
$grid_id = $controller . '-jqGrid'; $grid_id = $grid_div_id . '-jqGrid';
if (!isset($search_fields)) if (!isset($search_fields))
$search_fields = array(); $search_fields = array();
@@ -129,6 +136,9 @@ foreach ($jqGridColumns AS &$col) {
// to kick this thing off. // to kick this thing off.
?> ?>
<DIV ID="<?php echo $grid_div_id; ?>" CLASS="<?php echo $grid_div_class; ?>">
<table id="<?php echo $grid_id; ?>" class="scroll"></table>
<div id="<?php echo $grid_id; ?>-pager" class="scroll" style="text-align:center;"></div>
<script type="text/javascript"><!-- <script type="text/javascript"><!--
jQuery(document).ready(function(){ jQuery(document).ready(function(){
@@ -160,6 +170,7 @@ jQuery(document).ready(function(){
)); ?> )); ?>
); );
<?php
/* jQuery('#t_<?php echo $grid_id; ?>').height(25).hide() */ /* jQuery('#t_<?php echo $grid_id; ?>').height(25).hide() */
/* .filterGrid('#<?php echo $grid_id; ?>', { */ /* .filterGrid('#<?php echo $grid_id; ?>', { */
/* gridModel:true, */ /* gridModel:true, */
@@ -186,14 +197,12 @@ jQuery(document).ready(function(){
/* } */ /* } */
/* } */ /* } */
/* }); */ /* }); */
?>
}); });
--></script> --></script>
<table id="<?php echo $grid_id; ?>" class="scroll"></table>
<div id="<?php echo $grid_id; ?>-pager" class="scroll" style="text-align:center;"></div>
<?php <?php
if (count($search_fields) > 0) { if (count($search_fields) > 0) {
echo('<div>Search By:<BR>' . "\n"); echo('<div>Search By:<BR>' . "\n");
@@ -222,3 +231,7 @@ jQuery(document).ready(function(){
echo('</div>' . "\n"); echo('</div>' . "\n");
echo('</div>' . "\n"); echo('</div>' . "\n");
} }
// Finally, back to HTML mode, and end the grid DIV we created
?>
</DIV>

View File

@@ -22,7 +22,8 @@ if (isset($leases)) {
$leases), $leases),
'limit' => 5); 'limit' => 5);
} }
else {
$jqGrid_options += array('search_fields' => array('Customer', 'Unit')); $jqGrid_options += array('search_fields' => array('Customer', 'Unit'));
}
echo $this->element('jqGrid', $jqGrid_options); echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -8,6 +8,20 @@ $cols['Size'] = array('index' => 'UnitSize.name', 'width' => '75');
$cols['Status'] = array('index' => 'Unit.status', 'width' => '75'); $cols['Status'] = array('index' => 'Unit.status', 'width' => '75');
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment'); $cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
echo $this->element('jqGrid', $jqGrid_options = array('jqGridColumns' => $cols,
array('jqGridColumns' => $cols)); 'controller' => 'units',
'caption' => isset($caption) ? $caption : null);
if (isset($units)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$units),
'limit' => 5);
}
else {
$jqGrid_options += array('search_fields' => array('Unit', 'Size', 'Status'));
}
echo $this->element('jqGrid', $jqGrid_options);

View File

@@ -27,7 +27,7 @@ table caption { text-align: left;
padding-bottom: 0.5em; padding-bottom: 0.5em;
} }
table.item { margin-bottom: 1.5em; } div.item.list { margin-bottom: 1.5em; }
/* table.item caption { margin-top: 1em; } */ /* table.item caption { margin-top: 1em; } */
/* table.detail caption { margin-top: 0; } */ /* table.detail caption { margin-top: 0; } */
@@ -68,7 +68,8 @@ table.detail { width : 60%;
float: left; } float: left; }
table.detail td.field { width: 10em; } table.detail td.field { width: 10em; }
div.detail.supporting { clear : both; } div.detail.supporting { clear : both;
padding-top: 1.5em; }