All Rows Selected by Default
All Rows Selected by Default
I am using DataTables in my Rails application and I'm attempting to upgrade to the Buttons and Select extensions in place of TableTools. In order to do this, I started by making a new DataTable using the new extensions. Everything works as expected, except for one thing: all of the table entries load with the selected class applied. And I can't figure out why. Has anyone else had this issue?
The DataTable itself is pretty standard. It gets run at page load and successfully gets data from my backend:
var table = $('#provider-setups').dataTable({
lengthMenu: [25, 50, 100],
serverSide: true,
processing: true,
deferRender: true,
retrieve: true,
select: true,
buttons: buttons,
dom: '<"row"<"col-xs-2"l><"col-xs-7"B><"col-xs-3"f>><"row"<"col-xs-6"><"col-xs-6"p>><t><"row"<"col-xs-6"i><"col-xs-6"p>>',
ajax: {
url: dataTableUrl,
type: 'GET',
data: function (d) {
return $.extend( {}, d, {});
}
}
});
I have these in my application.js:
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require turbolinks
//= require js-routes
//= require highcharts
//= require highcharts-more
//= require drilldown
//= require exporting
//= require moment
//= require bootstrap-datetimepicker
//= require bootstrap-switch
//= require datatables
//= require datatables-colvis
//= require datatables-colreorder
//= require datatables-bootstrap3-plugin
//= require datatables-responsive
//= require datatables-keytable
//= require datatables-scroller
//= require datatables-tabletools
//= require datatables-buttons
//= require datatables-buttons/buttons.bootstrap
//= require datatables-select
//= require jquery-ui
// require bootstrap-sweetalert
//= require sweetalert
//= require bootstrap-daterangepicker
//= require jquery.serializeJSON
And these in application.css:
*= require_self
* require jquery.dataTables.min
*= require datatables-bootstrap3-plugin
*= require datatables-colreorder
*= require datatables-colvis
*= require datatables-keytable
*= require bootstrap-daterangepicker
*= require datatables-scroller
*= require datatables-tabletools
*= require datatables-buttons/buttons.bootstrap
*= require datatables-select/select.bootstrap
*= require jquery-ui
* require bootstrap-sweetalert
*= require bootstrap-switch
*= require sweetalert
*= require main
Anyone know what might be causing these rows to show up selected?
Answers
We'd really need a link to the page to understand what is going on.
Allan
I can't give you that. Does this screenshot help?
https://drive.google.com/file/d/0B4OMY2bdR3rhNWN4MjVBY2ZQamc/view?usp=sharing
No really to be honest. I was able to picture the rows being selected :-). I'd really need to be able to debug a page that demonstrates the issue to understand what is going wrong and why.
Allan
Yeah sorry. I can't legally show you the site :(
Thanks anyway