1

In my Joomla3.6 component, I am trying to implement drag and drop ordering at the frontend. I followed Adding drag-n-drop ordering in component and I can move the list-items, but it never saves the new order.

I tried to overwrite saveOrderAjax() at the controller, but it seems that it is not even called.

Any idea? Does anybody know a component with frontend-ordering?

1
  • check if your front-end component view table has ordering field in it's table.
    – Liz.
    Feb 7, 2017 at 6:49

1 Answer 1

1

Thank you for that comment, @Liz, that pointed me to the solution. I already had the ordering field, but now I found out that it only works, if the controller of the list-view points to the model for the form-view:

class MyCompControllerOrderings extends JControllerAdmin
{
    public function getModel($name = 'MyModelForTheTable', $prefix = 'MyCompModel', $config = array('ignore_request' => true)) {
        $model = parent::getModel($name, $prefix, $config);
        return $model;
    }
}

And this model only works, if it defines public function getTable and public function getForm.

It seems not to be enough to define the getTable method, but why?

Anyhow, now it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.