how to use datatable editor with a mysql database

how to use datatable editor with a mysql database

enrico.scottinienrico.scottini Posts: 2Questions: 1Answers: 0
edited December 2014 in Editor

Hi all,
I tried to use the editor extension for my database. I use a db connection in a file.php, where I populate my table.

So, I create table and populate it in the same page (with sql query and a loop into this).

First question: It's correct to populate the table with this method?
And second: where I can change the functions of buttons new, edit and delete? (and if it's possibile keep the current forms).

I'm sorry for the english :)

Thanks

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Hi,

    Have you followed the Editor getting started guide?

    Allan

  • enrico.scottinienrico.scottini Posts: 2Questions: 1Answers: 0

    Hi, yes I have.
    But I did not see how to use the editor with a database.
    However I did it. But now I wold like to change the create function.
    I'm in the "Editor.prototype.submit" function, where, with an for each loop I would like to get all data insert from the user, but I can also get the name of label.
    My code is this:

    Editor.prototype.submit = function ( successCallback, errorCallback, formatdata, hide )
    {
    .....
    $.each( fields, function ( name, field ) {
    console.log("name: "+name+" - field: "+field);
    } );
    .......
    }

    The "field" param return an [object Object].
    How can I get the value insert from the users?
    It's correct what I did?

    And there is a method to hide a param in the create form? (example: I don't want that users can insert the number of id).

    Thanks

This discussion has been closed.