Row Reorder custom ajax URL

Row Reorder custom ajax URL

Roman RodzewiczRoman Rodzewicz Posts: 1Questions: 0Answers: 0

Hi,
I need to adapt datatables editor code for my existing backend system. I have no problem with Create, Edit and Remove methods, but I got stuck with rows reorder... Simply speaking I need to set different URL for ajax reorder request than is set for Edit. What I can do is:

ajax: {
    create: {
        type: 'POST', 
        url:  "url/for/resource",
    },
    edit: {
        type: 'PUT',
        url:  "url/for/resource/_id_",
    },
    remove: {
        type: 'DELETE',
        url:  "url/for/resource/_id_"
    }
}

But what I need to do is something like:

ajax: {
    create: {
        type: 'POST', 
        url:  "url/for/resource",
    },
    edit: {
        type: 'PUT',
        url:  "url/for/resource/_id_",
    },
    reorder: {
        type: 'PUT',
        url:  "url/for/resource/reorder"
    },
    remove: {
        type: 'DELETE',
        url:  "url/for/resource/_id_"
    }
}

Thanks for any help.

Replies

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    The reorder is really just an edit - with only the sequence column being modified - so you just need to go with the top option,

    Colin

This discussion has been closed.