<?xml version="1.0" encoding="UTF-8" ?>
<dt-button library="Buttons">
	<name>colvis</name>
	<summary>A button collection that provides column visibility control</summary>
	<since>1.0.0</since>

	<requires>
		* Buttons' _Column visibility button_ plug-in
	</requires>

	<description>
		This button will create a collection button that when activated will show a list of the columns in the table and provide the end user with the ability to toggle column visibility to suit their own requirements.
	</description>

	<extend>collection</extend>

	<option type="string" name="text" default="Column visibility">
		The button's display text. The text can be configured using this option (see `b-init buttons.buttons.text`) or the `buttons.colvis` option of the DataTables `dt-init language` object.
	</option>

	<option type="string" name="className" default="buttons-collection buttons-colvis">
		The button's class name. See `b-init buttons.buttons.className` for details.
	</option>

	<option type="function" name="action">
		Show the collection to control column visibility.
	</option>

	<option type="column-selector" name="columns" default="undefined">
		Columns selector that defines the columns to include in the column visibility button set. By default this is `-type undefined` which results in all columns being selected, but any of the `-type column-selector` options can be used to define a custom button set.
	</option>

	<option type="function" name="columnText" default="undefined" since="1.3.0">
		Callback function that provides the ability to modify or replace the text used for each button in the list. This function is executed once for each button.

		It accepts three parameters:

		* `-type DataTable.Api`: DataTable API instance
		* `-type integer`: Column data index for the button being created
		* `-type string`: The title for the button created by Buttons (derived from the column title)

		The return value is a `-type string` that will be used for the button's text.
	</option>


	<example title="DataTables initialisation: Show the `colvis` button with default options"><![CDATA[

$('#myTable').DataTable( {
	buttons: [ 'colvis' ]
} );

]]></example>

	<example title="Direct initialisation: Show the `colvis` button, but do not include the first column in the list of columns"><![CDATA[

new $.fn.dataTable.Buttons( table, {
	buttons: [
		{
			extend: 'colvis',
			columns: ':gt(0)'
		}
	]
} );

]]></example>

	<example title="Customisation of the button text for the individual columns"><![CDATA[

$('#myTable').DataTable( {
	dom: 'Bfrtip',
	buttons: [ {
		extend: 'colvis',
		columnText: function ( dt, idx, title ) {
			return (idx+1)+': '+title;
		}
	} ]
} );

]]></example>


</dt-button>