[英]Joomla's Hathor template pagination not working with custom backend component
編寫了一個自定義的后端組件,一切正常。 僅允許一部分用戶訪問該用戶,因此我從Hathor創建了一個修改后的模板,以消除所有我無法使用權限的東西。
發現分頁不僅適用於Hathor。 我在Bluestork上嘗試過,效果很好。 我還用Hathor(原始的和未修改的)和Bluestork對文章分頁進行了測試,並且都可以工作。 也看不到任何錯誤。
是什么導致我的組件中的分頁功能不適用於Hathor?
這是我用於分頁的代碼:
模型:
...other query stuff...
//Column ordering
$orderCol = $this->getState('list.ordering'); //Ordering
$orderDirn = $this->getState('list.direction'); //Direction
if ($orderCol != '') {
$query->order($db->getEscaped($orderCol.' '.$orderDirn));
} //end column ordering
return $query;
}
view.html.php
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); //getting this automatically and being assigned to the view
$this->state = $this->get('State'); //for published state drop down
default.php:
<input type="hidden" name="filter_order" value"<?php echo $listOrder; ?>" /> <!-- for sorting -->
<input type="hidden" name="filter_order_Dir" value"<?php echo $listDirn; ?>" /> <!-- for list direction -->
任何人都對可能發生的事情有任何想法?
如果與“ adminform”表單發生沖突,則可能會發生這種情況,要么是兩個都不存在,要么默認的Joomla導航不起作用(上面的某些按鈕也不起作用)
我總結了一下Chrome中輸出的一些管理模板,發現沒有引入大量代碼。這似乎與模式窗口有關,因此我在模板的include標題下添加了此代碼:
<?php JHtml::_('behavior.modal'); ?>
我猜分頁使用相同的js文件。 不知道為什么它沒有加入,也許是因為我限制了它認為沒有被使用的大量后端的訪問?
無論如何-固定!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.