Made the same layout changes from H2 to CSS with the move_in page

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@271 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-09 00:21:48 +00:00
parent 849077bb9a
commit 233b08df59

View File

@@ -64,26 +64,26 @@ function onRowSelect(grid_id, item_type, item_id) {
$("#movein-"+item_type).html($(grid_id).getCell(item_id, cell_name));
// Hide the "no customer" message and show the current customer
$("#no-"+item_type).hide();
$("#current-"+item_type).show();
$("."+item_type+"-selection-invalid").hide();
$("."+item_type+"-selection-valid").show();
$("#"+item_type+"s-list .HeaderButton").click();
}
function onGridState(grid_id, item_type, state) {
if (state == 'visible') {
$("#no-"+item_type).hide();
$("#current-"+item_type).hide();
$("."+item_type+"-selection-invalid").hide();
$("."+item_type+"-selection-valid").hide();
}
else {
//if ($(grid_id).getGridParam("selrow"))
//alert("id:" + $("#"+item_type+"-id").val());
if ($("#"+item_type+"-id").val() > 0) {
$("#current-"+item_type).show();
$("#no-"+item_type).hide();
$("."+item_type+"-selection-invalid").hide();
$("."+item_type+"-selection-valid").show();
} else {
$("#current-"+item_type).hide();
$("#no-"+item_type).show();
$("."+item_type+"-selection-invalid").show();
$("."+item_type+"-selection-valid").hide();
}
}
}
@@ -105,10 +105,17 @@ echo $this->element('customers', array
'limit' => 10,
)));
echo ('<H2>' .
'<SPAN id="current-customer">Customer: <SPAN id="movein-customer"></SPAN></SPAN>' .
'<SPAN id="no-customer">Please select customer</SPAN>' .
'</H2>' . "\n");
echo ('<DIV CLASS="move-in grid-selection-text">' .
'<DIV CLASS="customer-selection-valid" style="display:none">' .
'Customer: <SPAN id="movein-customer"></SPAN>' .
'</DIV>' .
'<DIV CLASS="customer-selection-invalid" style="display:none">' .
'Please select customer' .
'</DIV>' .
'</DIV>' . "\n");
echo $this->element('units', array
('config' => array
@@ -122,10 +129,17 @@ echo $this->element('units', array
'limit' => 10,
)));
echo ('<H2>' .
'<SPAN id="current-unit">Unit: <SPAN id="movein-unit"></SPAN></SPAN>' .
'<SPAN id="no-unit">Please select unit</SPAN>' .
'</H2>' . "\n");
echo ('<DIV CLASS="move-in grid-selection-text">' .
'<DIV CLASS="unit-selection-valid" style="display:none">' .
'Unit: <SPAN id="movein-unit"></SPAN>' .
'</DIV>' .
'<DIV CLASS="unit-selection-invalid" style="display:none">' .
'Please select unit' .
'</DIV>' .
'</DIV>' . "\n");
echo $form->create(null, array('id' => 'move-in-form',
'url' => array('controller' => 'leases',
@@ -167,21 +181,17 @@ echo $form->end('Move In Customer');
<?php if (isset($customer['id'])): ?>
$("#customer-id").val(<?php echo $customer['id']; ?>);
$("#movein-customer").html("<?php echo $customer['name']; ?>");
$("#current-customer").show();
$("#no-customer").hide();
onGridState(null, 'customer', 'hidden');
<?php else: ?>
$("#current-customer").hide();
$("#no-customer").hide();
onGridState(null, 'customer', 'visible');
<?php endif; ?>
<?php if (isset($unit['id'])): ?>
$("#unit-id").val(<?php echo $unit['id']; ?>);
$("#movein-unit").html("<?php echo $unit['name']; ?>");
$("#current-unit").show();
$("#no-unit").hide();
onGridState(null, 'unit', 'hidden');
<?php else: ?>
$("#current-unit").hide();
$("#no-unit").hide();
onGridState(null, 'unit', 'visible');
<?php endif; ?>
});
--></script>