<button type="button" class="btn bg-gradient-secondary btn-colvis" style="border-left: 1px solid rgba(0,0,0,0.1);">
	<i class="fa fa-fw fa-columns"></i>
</button>

@push('js')
	<script>
		var $colvis = $('#{{ $model }}-table-header .btn-colvis');

		$colvis.on( 'click', function () {
			var table = getDatatable("{{ $model }}");
			// console.log(table);

			// console.log(table.column(1).dataSrc());
			var header = table.column(1).header();
			// console.log($(header).html());
			var visible = table.column(1).visible();
			// console.log(visible);

/*
			// var names = table.columns().names();
			columns = table.columns();
			console.log(columns);

			var names = columns.names();
			console.log(names);

			// table.search($search.val()).draw();
			buttons = table.buttons();
			console.log(table.button('colvis'));
			console.log(buttons);
*/

/*
			for (var i = buttons.length - 1; i >= 0; i--) {
				console.log(buttons[i]);
			}
*/
		});	
	</script>
@endpush	
