RowReorder Editor with different name and data fields

RowReorder Editor with different name and data fields

SavinienSavinien Posts: 12Questions: 6Answers: 1

Hello,

I am having a small problem with RowReorder and the Editor. My server sends me the data slightly different than it expects it to be read. Namely, every field has a "data." in front of it, which should not be sent to the server.

For the normal use of the Editor this is no problem. I use the editor like this and all workds fine. data.index is read and index is sent:

reorderEditor = new $.fn.dataTable.Editor({
    fields: [{
        name: "index",
        label: "Index",
        data: "data.index",
    },]
});

This seems to not work with Reorder though. I would think the reorder should be like this:

rowReorder:~~~~ {
    dataSrc: "data.index",
    editor: reorderEditor,
},

Now I get an error message, that there is no field data.index in the editor. So it seems the name for the field in the editor and the dataSrc must be the same. Changing the data-value in the editor seems to have no effect at all.

When I use "index" for both I get an empty list to my server: data[0][index]=""
When I use "data.index" for both of them I get a wrong qualifier data within them: 'data[0][data][index]=3'

I can not seem to figure the correct way of making them work in concert. Could you help me with this please?

Cheers
Rüdiger

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    Hi Rüdiger,

    Could you send me a sample of the data so I can take a look? Or even better would be a link to the page showing the issue?

    Thanks,
    Allan

  • SavinienSavinien Posts: 12Questions: 6Answers: 1

    Hi there,
    sorry for the late answer. I can not reproduce tis behavious publicly, as the data is on our private server. We had to tweak the datamodell slightly ayway so I do not see the same problem anymore. I guess it was a fluke on our side. Sorry for that.
    Rüdiger

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin
    Answer ✓

    No worries - great to hear you've got it working now.

    Allan

This discussion has been closed.