繁体   English   中英

Joomla的Hathor模板分页不适用于自定义后端组件

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM