Ticket #259 修改了heihe view中ajax分页模板

This commit is contained in:
Li Jianxuan 2011-11-24 03:30:48 +00:00
parent c1c799b9a1
commit 94768c5986
3 changed files with 28 additions and 2 deletions

View File

@ -645,7 +645,7 @@ class DataController extends Zend_Controller_Action
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(5);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_ajax.phtml');
Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_literature.phtml');
$this->config = Zend_Registry::get('config');
if ($paginator)
{

View File

@ -0,0 +1,26 @@
<?php if ($this->pageCount): ?>
<div class="paginationControl">
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<a href="javascript:void(0);" onclick="literature(<?php echo $this->previous;?>)">&lt; Previous</a>
<?php else: ?>
<span class="disabled">&lt; Previous</span>
<?php endif; ?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
<a href="javascript:void(0);" onclick="literature(<?php echo $page;?>)"><?= $page; ?></a>
<?php else: ?>
<span class="current"><?= $page; ?></span>
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<a href="javascript:void(0);" onclick="literature(<?php echo $this->next;?>)">Next &gt;</a>
<?php else: ?>
<span class="disabled">Next &gt;</span>
<?php endif; ?>
</div>
<?php endif; ?>

View File

@ -347,7 +347,7 @@ function literature(page){
type:"GET",
url:"/data/literature/uuid/<?= $md->uuid; ?>",
data:'page='+page,
success:function(html){$('#literature').html('<ul>'+html+'</ul>');$('#literature .paginationControl a').attr('onclick',$('#literature .paginationControl a').attr('onclick').replace(/ajaxpage/i,"literature"));},
success:function(html){$('#literature').html('<ul>'+html+'</ul>');},
beforeSend:function(){$('#literature').html('<img src="/images/loading.gif" />加载中');}
});
};