Hide column in main table for Editor

Hide column in main table for Editor

webpointzwebpointz Posts: 126Questions: 30Answers: 4

Is it possible to hide a column in the datatable used for the editor?

I have tried using in the .JS file:

"columnDefs": [
            {
                "targets": [ 0 ],
                "visible": false,
                "searchable": false
            }
        ],  

But it doesn't work.

This question has an accepted answers - jump to answer

Answers

  • mRendermRender Posts: 151Questions: 26Answers: 13

    I believe you are looking for something like this...

    fields: [  {
                    label: "RecordID:",
                    name: "time.recordID",
            type: "hidden" 
                },
    

    The columnDefs are what you see in the actual HTML table, not what you put in the editor.

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4
    edited May 2015

    Actually, I want to have the user id in the main HTML table to pass to a Modal window but not show as a column in the main HTML table.

  • allanallan Posts: 61,863Questions: 1Answers: 10,135 Site admin
    Answer ✓

    The columns.visible option should work. If it isn't, then my guess (only guessing without a test case :-) ) is that you are using Responsive. If that is the case assign the class never to that column.

    Allan

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4

    Thanks Allan, I have table as responsive. How so I assign a class to that column?

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4

    Nevermind...I got it, thanks

  • allanallan Posts: 61,863Questions: 1Answers: 10,135 Site admin

    For anyone else - columns.className.

    Allan

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4
    { className: "never", "targets": [ 0 ] }
    
This discussion has been closed.