Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

hide column [data: {}] with conditional?

$
0
0
   let user=$('#user').val();

 "columns": [
           //{ data: 0 },
           { data: 1 },
            { data: 2 },
           //here how can I do something like that?
           if(user=='admin'){
                 { 
                     "render" function ( data, type, row ) {
                     }
                   }           
            }else{
                //If you do not comply, do nothing.
             }
    ]

How can I do something like this?

what I want is that if the user is an administrator,
Show me the action buttons.
if it is another user it does not show anything.

thanks for the answers


Viewing all articles
Browse latest Browse all 2364