2015年1月12日 星期一

[jQuery] Datatable: Some Hints

Be careful when using datatables, the following should take into account

  1. If you try to do some column visible/invisible work, you need to clear cookies to take effect or you may not see any differences
     
    $('#example').dataTable( {
      "columnDefs": [
        { "visible": false, "targets": 0 }
      ]
    } );

    For the above, we specify the column 0 to be invisible, but when I refresh my page, I cannot see anything, we need to clear the cookies to achieve the changes, the only reason for this I guess would be the bState parameter which use the cookie to save the sorting history and other datatable profiles.

    ***And usually you may need to restart the chrome browser with the private mode to reflect the changes***

I will update this doc if any new hints of datatables found.

沒有留言:

張貼留言