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