Custom options at initialization

Custom options at initialization

ilzatilzat Posts: 3Questions: 1Answers: 0

Hello,
How connect another options?

like this:
$.extend( $.fn.dataTable.defaults, {
searching: false,
ordering: false
} );

Answers

  • allanallan Posts: 63,834Questions: 1Answers: 10,518 Site admin

    I don't really understand the question I'm afraid. You can simply add other options into your object if you want other options to be set by default.

    Allan

  • ilzatilzat Posts: 3Questions: 1Answers: 0

    Ok. I will try to explain
    I need dynamically edit my table. The script should change the number and names of columns, depending on the user's actions.
    Should only change this code:
    columns: [
    { name: "_id", data: "mods.mod_id" },
    { name: "_name", data: "mods.size" },
    { name: "_property", data: "mods.weight_1_m2" }
    ],

    I want to make this code as a separate setup. If necessary - change.
    and display the table every time with option:
    "destroy": true

  • allanallan Posts: 63,834Questions: 1Answers: 10,518 Site admin

    I'm afraid I still don't really understand. You've set your defaults above, and then you initialise the columns. I don't understand what the problem with that is. That should work exactly as you describe.

    Allan

  • ilzatilzat Posts: 3Questions: 1Answers: 0

    Hi allan, it really works, wonderful !
    But I think that there is a target solution with API.
    Thank you!

This discussion has been closed.