1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-28 01:54:15 +01:00
DataTables/examples_src/basic_init/hidden_columns.xml

40 lines
1.3 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html">
<css lib="datatables" />
<js lib="jquery" />
<js lib="datatables" />
<title>Hidden columns</title>
<js><![CDATA[
$(document).ready(function() {
$('#example').dataTable( {
"columnDefs": [
{
"targets": [ 2 ],
"visible": false,
"searchable": false
},
{
"targets": [ 3 ],
"visible": false
}
]
} );
} );
]]></js>
<info><![CDATA[
There are times when you might find it useful to display only a sub-set of the information that was available in the original table. For example you might want to reduce the amount of data shown on screen to make it clearer for the user. This is done through the `dt-init visible` column option.
The column that is hidden is still part of the table and can be made visible through the `api column().visible()` API method at a future time if you wish to have columns which can be shown and hidden.
Furthermore, as the hidden data is still part of the table, it can still, optionally, be filtered upon allowing the user access to that data (for example 'tag' information for a row entry might used).
In the table below both the platform and engine version columns have been hidden, the former is searchable, the latter is not.
]]></info>
</dt-example>