Row Reorder dataSrc error

Row Reorder dataSrc error

OpticNectarOpticNectar Posts: 4Questions: 1Answers: 0

I'm using dataSrc in rowReorder, but I keep getting the Uncaught Unknown field name - order error. I'm using a field that isn't in the table itself, but is in each object returned from the server.

rowReorder: {
    selector: 'tr',
    dataSrc: 'order',
    editor: editor
}

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Seems like this might be a bug. @allan can confirm. According to the rowReorder.dataSrc docs:

    any property in the data source object can be used

    As a workaround you could add 'order' as a columns then use Datatables to hide it using columns.visible.

    Kevin

  • allanallan Posts: 63,457Questions: 1Answers: 10,466 Site admin

    As far as I am aware there aren't any bugs there, but I might just not be aware of it. @OpticNectar - could you give me a link to your page so I can check it out please?

    I have a feeling that you don't have an order field defined in your Editor field list, and the problem is that when reorder, Editor attempts to updates the data, and finds it can't. The ``-init rowReorder.dataSrc` option doesn't need to be in a column, but if you are using Editor, it does need to be in a field.

    Allan

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    field defined in your Editor field list

    That's why it didn't work for me when I did a quick test :smile:

    Kevin

This discussion has been closed.