【发布时间】:2012-12-26 14:45:09
【问题描述】:
编写了一个自定义后端组件,运行良好。仅允许一部分用户访问它,因此我从 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 -->
有人对可能发生的事情有任何想法吗?
【问题讨论】:
-
当您说“分页不起作用”时,您实际看到的是什么? (例如,所有记录/没有记录/其他内容)另外,您问的是“分页”问题,但您列出的来自
default.php的部分与过滤有关... -
感谢您的回复 - 抱歉花了这么长时间才回复。它只是在 URL 中显示了一个
#并没有执行任何操作就转到了页面顶部。我最终包含了修复它的模式窗口的文件(见下文)。