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),
'limit' => 5);
}
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
else {
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
}
echo $this->element('jqGrid', $jqGrid_options);

View File

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

View File

@@ -9,13 +9,13 @@ if (!isset($limit))
if (!isset($limitOptions)) {
$limitOptions = array();
if ($limit < 10)
$limitOptions += array(2, 5);
array_push($limitOptions, 2, 5);
if ($limit < 30)
$limitOptions += array(10, 25);
array_push($limitOptions, 10, 25);
if ($limit > 10)
$limitOptions += array(50, 200);
array_push($limitOptions, 50, 200);
if ($limit > 20)
$limitOptions += array(500);
array_push($limitOptions, 500);
}
if (!isset($height))
@@ -24,8 +24,15 @@ if (!isset($height))
if (!isset($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))
$grid_id = $controller . '-jqGrid';
$grid_id = $grid_div_id . '-jqGrid';
if (!isset($search_fields))
$search_fields = array();
@@ -129,6 +136,9 @@ foreach ($jqGridColumns AS &$col) {
// 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"><!--
jQuery(document).ready(function(){
@@ -160,6 +170,7 @@ jQuery(document).ready(function(){
)); ?>
);
<?php
/* jQuery('#t_<?php echo $grid_id; ?>').height(25).hide() */
/* .filterGrid('#<?php echo $grid_id; ?>', { */
/* gridModel:true, */
@@ -186,14 +197,12 @@ jQuery(document).ready(function(){
/* } */
/* } */
/* }); */
?>
});
--></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
if (count($search_fields) > 0) {
echo('<div>Search By:<BR>' . "\n");
@@ -222,3 +231,7 @@ jQuery(document).ready(function(){
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),
'limit' => 5);
}
$jqGrid_options += array('search_fields' => array('Customer', 'Unit'));
else {
$jqGrid_options += array('search_fields' => array('Customer', 'Unit'));
}
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['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
echo $this->element('jqGrid',
array('jqGridColumns' => $cols));
$jqGrid_options = 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;
}
table.item { margin-bottom: 1.5em; }
div.item.list { margin-bottom: 1.5em; }
/* table.item caption { margin-top: 1em; } */
/* table.detail caption { margin-top: 0; } */
@@ -68,7 +68,8 @@ table.detail { width : 60%;
float: left; }
table.detail td.field { width: 10em; }
div.detail.supporting { clear : both; }
div.detail.supporting { clear : both;
padding-top: 1.5em; }