简体   繁体   中英

Joomla's Hathor template pagination not working with custom backend component

Wrote a custom backend component, been working fine. A subset of users were only allowed access to that so I created a modified template from Hathor to eliminate everything I couldn't using permissions.

Found out that the pagination isn't working for just Hathor. I tried it with Bluestork and it worked fine. I also tested article pagination with both Hathor (original and unmodified) and Bluestork and both worked. Don't see any errors popping up either.

What could be causing the pagination in my component to not work with Hathor?

Here's the code I'm using for pagination:

Model:

...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 -->

Anyone have any ideas as to what could be going on?

如果与“ adminform”表单发生冲突,则可能会发生这种情况,要么是两个都不存在,要么默认的Joomla导航不起作用(上面的某些按钮也不起作用)

I wound up comparing a few of the admin templates output in Chrome and found there was a significant amount of code not being pulled in. It seemed to be related to a modal window, so I added this under the include head line in my template:

<?php JHtml::_('behavior.modal'); ?>

I guess the pagination uses the same js files. Not sure why it wasn't pulling in, maybe because I restricted access to so much of the backend it didn't think it was used?

At any rate - fixed!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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