AJAX pagination working on Enquiry table on user views

This commit is contained in:
Karl Cordes 2011-03-17 11:01:15 +11:00
parent 1f33242874
commit 7bd1abe2c7
3 changed files with 50 additions and 42 deletions

View file

@ -1,14 +1,23 @@
<?php echo $javascript->link('jquery.jeditable.mini'); ?>
<?=$javascript->link('ajax_pagination'); ?>
<?php echo $paginator->options(array('url'=>$this->passedArgs)); ?>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
'format' => __('Page %page% of %pages%, showing %current% Enquiries out of %count% total, starting on record %start%, ending on %end%', true)
));
?>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>
<table cellpadding="0" cellspacing="0" class="mer">
<tr>
<th><?php echo $paginator->sort('user_id');?></th>

View file

@ -3,7 +3,7 @@
<span id="userID" style="display: none;"><?=$user['User']['id']?></span>
<div class="users view">
<h2><?php __('User: '.$user['User']['username'] );?></h2>
<h2><?php __('User: '.$user['User']['username'] );?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Username'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
@ -37,10 +37,9 @@
<button id="show" class="showHide">Show</button>
<button id="hide" class="showHide">Hide</button>
<div id="enquiryTable">
<div id="ajaxLoad" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
</div>
<div id="enquiryTable">
<? /* If there are enquiries for this user, render the enquiries table passing the $enquiries array */ ?>
<?php if (!empty($user['Enquiry'])) {
@ -50,4 +49,5 @@
echo "No Enquiries for this User";
}
?>
</div>
</div>

View file

@ -4,7 +4,6 @@ $(function() {
$('#enquiryTable').hide();
$("#ajaxLoad").hide();
$("#ajaxLoad").bind("ajaxSend", function() {
$(this).show();
}).bind("ajaxComplete", function() {