Standardized the grid events interface, to ease the burden on the views and ensure that the load functions could be used by the application without wiping out the debug functionality that was built into jqGrid.ctp
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@336 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -8,24 +8,9 @@
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Grid Setup / Javascript
|
||||
* Javascript
|
||||
*/
|
||||
|
||||
$lease_grid_setup = array();
|
||||
|
||||
if (isset($lease['Lease']['id']))
|
||||
$lease_grid_setup['hiddengrid'] = true;
|
||||
|
||||
$lease_grid_setup['onSelectRow'] = array
|
||||
('--special' =>
|
||||
'function(ids) { if (ids != null) { onRowSelect("#"+$(this).attr("id"), ids); } }'
|
||||
);
|
||||
|
||||
$lease_grid_setup['onHeaderClick'] = array
|
||||
('--special' =>
|
||||
'function(gridstate) { onGridState("#"+$(this).attr("id"), gridstate); }'
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
@@ -220,7 +205,14 @@ echo $this->element('leases', array
|
||||
'grid_div_class' => 'text-below',
|
||||
'caption' => ('<A HREF="#" ONCLICK="$(\'#leases-list .HeaderButton\').click();'.
|
||||
' return false;">Select Lease</A>'),
|
||||
'grid_setup' => $lease_grid_setup,
|
||||
'grid_setup' => array('hiddengrid' => isset($lease['Lease']['id'])),
|
||||
'grid_events' => array('onSelectRow' =>
|
||||
array('ids' =>
|
||||
'if (ids != null){onRowSelect("#"+$(this).attr("id"), ids);}'),
|
||||
'onHeaderClick' =>
|
||||
array('gridstate' =>
|
||||
'onGridState("#"+$(this).attr("id"), gridstate)'),
|
||||
),
|
||||
'nolinks' => true,
|
||||
'limit' => 10,
|
||||
)));
|
||||
|
||||
@@ -16,39 +16,9 @@ $move_type = preg_replace("/.*_/", "", $this->action);
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
*
|
||||
* Javascript
|
||||
*/
|
||||
|
||||
$customer_grid_setup = array();
|
||||
|
||||
if (isset($customer['id']))
|
||||
$customer_grid_setup['hiddengrid'] = true;
|
||||
|
||||
$customer_grid_setup['onSelectRow'] = array
|
||||
('--special' =>
|
||||
'function(ids) { if (ids != null) { onRowSelect("#"+$(this).attr("id"), "customer", ids); } }'
|
||||
);
|
||||
|
||||
$customer_grid_setup['onHeaderClick'] = array
|
||||
('--special' =>
|
||||
'function(gridstate) { onGridState("#"+$(this).attr("id"), "customer", gridstate); }'
|
||||
);
|
||||
|
||||
$unit_grid_setup = array();
|
||||
|
||||
if (isset($unit['id']))
|
||||
$unit_grid_setup['hiddengrid'] = true;
|
||||
|
||||
$unit_grid_setup['onSelectRow'] = array
|
||||
('--special' =>
|
||||
'function(ids) { if (ids != null) { onRowSelect("#"+$(this).attr("id"), "unit", ids); } }'
|
||||
);
|
||||
|
||||
$unit_grid_setup['onHeaderClick'] = array
|
||||
('--special' =>
|
||||
'function(gridstate) { onGridState("#"+$(this).attr("id"), "unit", gridstate); }'
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
@@ -109,7 +79,14 @@ if ($move_type !== 'out') {
|
||||
'grid_div_class' => 'text-below',
|
||||
'caption' => ('<A HREF="#" ONCLICK="$(\'#customers-list .HeaderButton\').click();'.
|
||||
' return false;">Select Customer</A>'),
|
||||
'grid_setup' => $customer_grid_setup,
|
||||
'grid_setup' => array('hiddengrid' => isset($customer['id'])),
|
||||
'grid_events' => array('onSelectRow' =>
|
||||
array('ids' =>
|
||||
'if (ids != null){onRowSelect("#"+$(this).attr("id"), "customer", ids);}'),
|
||||
'onHeaderClick' =>
|
||||
array('gridstate' =>
|
||||
'onGridState("#"+$(this).attr("id"), "customer", gridstate)'),
|
||||
),
|
||||
'nolinks' => true,
|
||||
'limit' => 10,
|
||||
)));
|
||||
@@ -135,7 +112,14 @@ if ($move_type !== 'out') {
|
||||
'grid_div_class' => 'text-below',
|
||||
'caption' => ('<A HREF="#" ONCLICK="$(\'#units-list .HeaderButton\').click();'.
|
||||
' return false;">Select Unit</A>'),
|
||||
'grid_setup' => $unit_grid_setup,
|
||||
'grid_setup' => array('hiddengrid' => isset($unit['id'])),
|
||||
'grid_events' => array('onSelectRow' =>
|
||||
array('ids' =>
|
||||
'if (ids != null){onRowSelect("#"+$(this).attr("id"), "unit", ids);}'),
|
||||
'onHeaderClick' =>
|
||||
array('gridstate' =>
|
||||
'onGridState("#"+$(this).attr("id"), "unit", gridstate)'),
|
||||
),
|
||||
'action' => 'unoccupied',
|
||||
'nolinks' => true,
|
||||
'limit' => 10,
|
||||
|
||||
Reference in New Issue
Block a user