colVis not works
colVis not works
antoniocib
Posts: 277Questions: 62Answers: 1
in ColVis
Hello, I've been trying for over an hour but I can't implement colVis in my code. I've tried a lot of libraries but nothing comes out.
This is my HTML:
This is JS:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950var
table = $(
'#Buono'
).DataTable( {
dom:
'BPfrtip'
,
//dom: 'lfBrtip',
paging:
false
,
ajax: {
url:
'php/table.Buono.php'
,
type:
'POST'
,
data:
function
(d) {
d.startDate = $(
'#startDate'
).val();
d.endDate = $(
'#endDate'
).val();
}
},
order:[10,8],
searchPanes:{
columns:[10],
hideCount:
true
},
//deferRender: true,
//colReorder: true,
colReorder:
true
,
buttons: [{
extend:
'colvis'
,
text:
'Main Columns'
,
columns:
':not(.noColVis):not(.extra)'
},
{
extend:
'colvis'
,
text:
'Extra Columns'
,
columns:
'.extra'
}],
columns:[
{
"data"
:
"buono.id_spedizione"
,
orderable:
false
,
searchable:
false
//0
},
{
"data"
:
"buono.data_spedizione"
,
orderable:
false
,
searchable:
false
//1
},
Answers
Are the buttons not showing?
Do you get errors in the browser's console?
Do you have your
noColVis
andextra
classes set to the appropriate columns?Please provide a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I solved thanks.