How to create the first row with the dataTable.Editor ?

How to create the first row with the dataTable.Editor ?

lnglng Posts: 2Questions: 1Answers: 0

I'd like to start from an empty datatable and use the datatable.editor to add a row.
When I try this, the editor send an error within the 'submit' fonction of the 'create button'.

My configuration regarding the editing section is as follow :

editorCreate = new $.fn.dataTable.Editor( {
        table: "#tableCommandes",
        fields: [       
            {
                label: "No commande:",
                name: "Title"
            }                                   
        ]

    } ); // editorCreate()

        ....

    var tableCommandes = $('#tableCommandes').DataTable({   
        ....
        buttons: [
                { extend: 'create', editor: editorCreate }
         ], 
        ...
     }

Is there a way to create a new row from an empty datatable ?

Answers

  • kthorngrenkthorngren Posts: 21,364Questions: 26Answers: 4,956

    There is nothing special that needs to be done to create a row from an empty table. I don't see anything in your code that would be a problem.

    What is the error you get?

    Is the data submitted to your server code?

    Kevin

  • lnglng Posts: 2Questions: 1Answers: 0

    Kevin,

    thank you for your quick reply.
    I'll be back at the office tomorrow morning (10 PM right now here...) and will give you more details then ...

    Laurent

This discussion has been closed.