Still old problem with data:null but didn't find answer....

Still old problem with data:null but didn't find answer....

DocNCDocNC Posts: 24Questions: 6Answers: 0

trying to make my site responsive.
so I need a "placeholder" on first col and here is my init object

var dtConfig = {
    dom:        "Bfrtip",
    responsive: true,
    ajax: {
        url: "listes/spip_approches/spip_approches.php",
        type: "POST",
        data: {
            "id_organisation": 7
        }
    },
    language: getLanguage(),
    serverSide: true,
    columns: [{
            data: null,
            defaultContent: '',
            className: 'control',
            orderable: false,
            searchable: false
        }, {
            "data": "id_approche",
            "visible": false /* */
        },
        {
            "data": "id_organisation",
            "visible": false /* */
        },
        {
            "data": "date_app",
            "className": "editable default",
            "render": "$.fn.dataTable.render.moment('D/MM/YYYY')",
            "width": "5em"
        },
        {
            "data": "type_app",
            "className": "editable default",
            "width": "8em"
        },
        {
            "data": "commentaire",
            "className": "editable default",
            "width": "100%"
        }
    ],
    buttons: [{
        extend: "create",
        editor: "editor"
    }, {
        extend: "edit",
        editor: "editor"
    }, {
        extend: "remove",
        editor: "editor"
    }, {
        extend: 'searchPanes',
        className: "btnPanes"
    }],
   
    select: false,

    "paging": false};

And I got the warning :
DataTables warning: table id=approches - Unknown field: (index 0)

I browse around and find I need to add

    orderable: false,
    searchable: false

but this didn't help.
Thanks for your help
Michel

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I'm not seeing that here: http://live.datatables.net/xowimepu/1/edit

    Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    Hi colin
    after using your fiddle (thanks a lot) and put your data/init in my code, I can't reproduce the bug with your data/init.
    therefore, Im using editor so maybe editor is the culprit with the fields and the json answers it sends ?

  • DocNCDocNC Posts: 24Questions: 6Answers: 0

    anyway I found a workaround in my business case. thanks for your help, but still unsolved.

This discussion has been closed.