How to implement drag-and-drop ordering in custom component?

by kalinma   Last Updated December 06, 2017 22:10 PM

I'm developing a custom Joomla component for an application and would like to implement drag-and-drop ordering in a list view on the admin site. I found an excellent guide here, Adding drag-n-drop ordering in component in the answer by user fruppel. However, something is missing that is not allowing me to save the re-ordering of items. I found that my controller does implement the saveOrderAjax() function because it extends JControllerAdmin, but my model does not implement the saveorder() function because, as it's a list view, I'm extending JModelList, which does not implement saveorder(). Only JModelAdmin has the saveorder() function.

The error I get in the error log is:

PHP Fatal error: Call to undefined method MyComponentModelMyListModel::saveorder() in C:\xampp\htdocs\mysite\libraries\legacy\controller\admin.php on line n

This makes no sense to me because a list view is supposed to use JModelList for its corresponding model, right? Has anyone succeeded at this task without writing something entirely new? I don't think extending JModelAdmin for my model here is practical.

Related Questions

Make a checkbox group disappear

Updated March 21, 2017 23:10 PM

Using CodeMirror editor in custom component

Updated October 09, 2016 09:04 AM

Different views on routher.php (Joomla! 3.6.4)

Updated February 05, 2018 23:10 PM