Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

Hi Chumper I want to create hidden column for searching by sex

Open azulkipli opened this issue 11 years ago • 3 comments

My code http://pastebin.com/V25ccnB4

I want to apply search using "sex" column that may have value "M" or "F" but real "sex" must be hidden.

How I convert this config to your "setOptions" method

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

reference: http://www.datatables.net/examples/basic_init/hidden_columns.html

azulkipli avatar Sep 04 '14 09:09 azulkipli

öhm... i'll give it a try:

setOptions(
  array(
    array(
      "targets" => array(2),
      "visible" => false,
      "searchable" => false)
    ),
    ...
  )

Chumper avatar Sep 15 '14 17:09 Chumper

Hi, Thank you for your help Sorry long time no comment from me.

Ive tried your sample code above in this code http://pastebin.com/TGY13ArG

I can search using "M" or "F" but the column still visible

So I want to hide "S (Sex)" column but I still can search the value http://postimg.org/image/m9q7r59h9/ Screenshot

azulkipli avatar Oct 08 '14 05:10 azulkipli

alter the sample code as follows, it works fine.

->setOptions("columnDefs", array( array( "targets" => array(0), "visible" => false, "searchable" => false ) ) )

arunnambissan avatar May 03 '16 09:05 arunnambissan