How to change position of items with drag&drop in MIGXdb grids?

Regular MIGX TVs have the ability to use drag&drop to sort the items in the grid, but I haven’t figured out how to do the same with a (paginated) MIGXdb grid.

Relevant code bits of my current config:

    "extended": {
        "migx_add": "Add software provider",
        "disable_add_item": "",
        "add_items_directly": "",
        "formcaption": "",
        "update_win_title": "Edit software provider",
        "win_id": 100001,
        "maxRecords": "",
        "addNewItemAt": "bottom",
        "media_source_id": "",
        "multiple_formtabs": "",
        "multiple_formtabs_label": "",
        "multiple_formtabs_field": "",
        "multiple_formtabs_optionstext": "",
        "multiple_formtabs_optionsvalue": "",
        "actionbuttonsperrow": 4,
        "winbuttonslist": "",
        "extrahandlers": "this.handlePositionSelector||this.handleColumnSwitch",
        "filtersperrow": 4,
        "packageName": "xxxxxxx",
        "classname": "xxxSoftware",
        "task": "",
        "getlistsort": "menuindex",
        "getlistsortdir": "ASC",
        "sortconfig": "",
        "gridpagesize": 20,
        "use_custom_prefix": "0",
        "prefix": "",
        "grid": "",
        "gridload_mode": 2,
        "check_resid": 1,
        "check_resid_TV": "",
        "join_alias": "",
        "has_jointable": "yes",
        "getlistwhere": "",
        "joins": "",
        "hooksnippets": "",
        "cmpmaincaption": "External sources",
        "cmptabcaption": "Software",
        "cmptabdescription": "A list of all software providers.",
        "cmptabcontroller": "",
        "winbuttons": "",
        "onsubmitsuccess": "",
        "submitparams": ""
    "columns": [
            "MIGX_id": "",
            "header": "Sort",
            "dataIndex": "menuindex",
            "width": 20,
            "sortable": true,
            "show_in_grid": 1,
            "customrenderer": "",
            "renderer": "this.renderPositionSelector",
            "clickaction": "",
            "selectorconfig": "",
            "renderchunktpl": "",
            "renderoptions": "",
            "editor": ""

This results in a little positioning menu appearing inside each item, which lets you choose the desired target position:

I don’t think this is very intuitive and client feedback confirms that. Is it possible to use regular drag&drop for this instead?

In the MIGX config → tab “MIGXdb-Settings” you can set the value of the field “Grid” to dragdrop.

But I believe this only works if the column you sort by is called “pos” (and not “menuindex” as in your case).

So you probably have to duplicate and change the file core/components/migx/templates/mgr/grids/dragdrop.grid.tpl to make it work.

See also this thread in the old forum:


This line has to be changed to ,col: 'menuindex:before' to sort elements in a column “menuindex”.


Thanks a bunch @halftrainedharry, that was the missing piece!

I’ll try to convert the menuindex field to pos, so it works natively. I’ll add an alias to menuindex in the database schema, so templating can remain untouched.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.