I would like to integrate Views Bulk Operations and DataTables together.
This would be awesome for handling large tables of data. For example to easily search for users and sign them up for an event.

Is there any way to do this?

Comments

mauritskorse’s picture

Right now I have an ugly fix for this:
I have added some js to the bottom of my page.tpl.php as that is sufficient for me right now. Anyway, it would be awesome if these two modules could be combined as one for views, especially for page specific tweaking of either of the two.

Here's the code

$(document).ready(function(){ 
  var pathname = window.location.pathname;
  var showDataTablesOn = {
    "/uc_signup/attendees" : true,
    "/node/88/signups/admin" : true,
    "/uc_signup/attendees/agora" : true,
    "/uc_signup/confirmations/agora" : true,
    "/uc_signup/attendees/simple-list" : true,
    "/admin/user/user2" : true,
    "/administration/store/order_management" : true
// add as many as you like
  };

  if(showDataTablesOn[pathname]){
    var Dtable = $('.views-table').dataTable({
      "iDisplayLength": 50,
    });
    if(Dtable){
      // focussing on the search field offered by dataTables
      $('.dataTables_filter input').focus(); 
    }
  }
});

dqd’s picture

Version: 6.x-1.x-dev » 8.x-1.x-dev
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
Issue tags: +vbo integration

VBO and DT have different approaches to show table items. I think it should not be used together. I am even not sure if this can be implemented without a huge amount of patches on both sides: VBO and DT itself (not the Drupal module, which only manages the implementation). This is not a bug, rather a feature request. And consider it as possible unfullfilled dream since we should not change DT core code. Or we should consider to put this issue in the VBO queue. But D6 is not supported no more and D7 has a feature freeze.

So we should check if this is still an issue for D8 at first and than discuss a possible roadmap.

Closed #2850458: DataTables Views with VBO Bulk Operations in favour of this one here (older).