Can't use post for editor ajax with fileupload

Can't use post for editor ajax with fileupload

LapointeLapointe Posts: 430Questions: 81Answers: 4

Hi all

I have a question about fileUpload
Using

    editor = new $.fn.dataTable.Editor( {     // initialisation de l'editeur
            ajax: {
                url: "getdata.php",
                type: 'POST',
                dataType: 'JSON',
                data: {
                    T:  'utilisateurs'
                },
            },
        table: "#donnees",

throw an error when uploading a file

else

    editor = new $.fn.dataTable.Editor( {
            ajax: {
                url: "getdata.php?T=utilisateurs",
                dataType: 'JSON',
            },
        table: "#donnees",

run correctly

Is it "normal" ?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923
    Answer ✓

    I haven't seen that error before but if you look at the ajax.data docs you will see some examples for using it as a function to pass data. Try changing to that and let us know the results.

    Kevin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @kthorngren

    Your OK.

                ajax: {
                    url: "getdata.php",
                    type: 'POST',
                    dataType: 'JSON',
                    data: function(d){
                        d.T='utilisateurs'
                    },
                },
    
    

    run OK

    Thanks
    Bob

This discussion has been closed.