-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ColVis #56
Comments
how have you managed to get it to works ? i'm struggeling getting it to work with my app i'm grabbind the data from my database with datatables/js 1.10 using ajax: { url : "myscript.php"} mind helping ? |
@MounirBennacer Wrong MIME type. Use rawgit to add scripts from Github. http://codepen.io/sloby/pen/eovwK @vedmack Thanks for your help! I read what the guys from DataTables replied to you and I managed to make it work. |
@sloby please share your solution so other can benefit from it :) |
Well, what I did is kinna dirty. I'm using v1.10 of Datatables so I took advantage of var table = $('#datagrid'),
datatable = table.dataTable({
// A gazillion lines here
})
.yadcf([{
column_number: 1,
filter_type: 'text'
}, {
column_number: 2,
filter_type: 'text'
}, {
column_number: 3,
filter_type: 'select',
select_type: 'chosen'
}, {
column_number: 4,
filter_type: 'text'
}, {
column_number: 5,
filter_type: 'select',
select_type: 'chosen'
}, {
column_number: 7,
filter_type: 'text'
}, {
column_number: 6,
filter_type: 'date'
}]);
// Since I toggle columns visibility with ColVis I can listen to what column is being hidden or shown
table.on('column-visibility.dt', function (e, settings, column, state) {
if (state === true) { // If the column is visible
datatable.yadcf([{
column_number: column, // column = column number
filter_type: 'text'
}]);
}
}); |
thx for the answer, unfortunatly it is not working at all, i've followed every bit of code but i'm not getting the input in the table headers thx |
@MounirBennacer , please use github issue tracker for concrete bugs/ feature request and google groups for general questions, @sloby forked your test case and used rawgit to include the resources and all looks well. so please provide a proper testcase and post a question in google groups |
Done, you can grab it from https://github.com/vedmack/yadcf/blob/master/lab/jquery.dataTables.yadcf.js 0.8.1.beta |
YADCF currently doesn't support implementation with ColVis plugin, which shows/hides table columns. If on page load ColVis is setted up to hide a certain column, when the user toggles the visibility of that column the filter corresonding to it doesn't show up.
The text was updated successfully, but these errors were encountered: