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).

nicolash’s picture

I know this is an old issue, but I also wanted to run a bulk operation on a set of data from a DT display. At least I assume that this issue is about that, rather than some deeper merging of functionality.

AFAICT there is only one UI bug preventing these from working seamlessly together right now, and that is that the VBO "Check all" box on top of a table display does not work. Neither does shift-selecting a range of table rows.

However, selecting checkboxes individually per row makes the VBO part behave just as it would with a standard table display, so there's no inherent incompatibility between the 2, just a front-end mismatch.

nicolash’s picture

Update on my comment above...

I checked whether any different selectors are applied on the VBO checkboxes in a DT display, but doesn't look like it. And then I realised that the very first time a DT display is loaded, the select-all and shift-select works just fine. It's only after filtering the DT display that those stop working.

My guess it's more an issue with how VBO runs these, but need to look into it more.