Editor1.3.2 - how to change table name?

Editor1.3.2 - how to change table name?

darlindarlin Posts: 9Questions: 1Answers: 0
edited August 2014 in Free community support

Which way I can change the name of the table (the same database).
I trying change on:

var editor = new $.fn.dataTable.Editor( {
"ajax": "php/table.object.php",
        "table": "#abcd", 

and

Editor::inst( $db, 'abcd', 'id' )

but it is not working

Replies

  • nigel pasconigel pasco Posts: 37Questions: 6Answers: 0

    Hi darlin,
    The '#table:' refers to the name fo the datatable that you are producing (

    ) and not the name of the SQL table. Make sure that this #table name matches the name of your table (

    <

    table name="abcd"...>).

    The second instance is the correct and should work fine.

    I hope that helps.
    nige

  • darlindarlin Posts: 9Questions: 1Answers: 0
    edited August 2014

    Ups...
    thx nigel. Now is ok.

    BTW, a what about if I would like to switch between more tables (the same columns)
    I should make variable session storage?
    something as:

    Editor::inst( $db, $_SESSION['abcd'], 'id' )
    

    It is good resolve?

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    That would certainly be one option. If the tables all have identical fields then there is no reason you couldn't do it that way. Another option, if they have different fields would be to have a different PHP field for each table and include it as needed.

    Allan

  • darlindarlin Posts: 9Questions: 1Answers: 0

    In case of different columns, I have to make second instance of editor and datatables?
    Which way I can switch between instances? is there any methods (table/editor visable?)

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    You would just use standard DOM or jQuery methods ($().show() for example, for css display: none`). Showing and hiding a table isn't something that DataTables has built in.

    Allan

This discussion has been closed.