Hello,

We are working on a project which using alot of datatables functionalities. We modified it to provide many dataTables features: dataTools, ColReorder, FixedColumns, ColVis, ... So we want contribute these modifications back to drupal community.

Thanks,

Andy

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robinl’s picture

Hi Andy,

Your developments sound great. I am looking to incorporate some of these other features too so please let me know if you are in a position to share this!

Thanks

Robin

duellj’s picture

Hi Andy,

I'd be happy to integrate the feature additions you mentioned. Do you have a patch?

robinl’s picture

Hi Andy,

Have you managed to get any further with sharing this info? I am really keen to implement these features too.

Many thanks

Robin

thehong’s picture

Title: Provide maintainance for drupal 6.x branch » Support DataTables plugins
FileSize
11.99 KB

Here's my patch. Still not support views yet.

thehong’s picture

Status: Active » Needs review
sachbearbeiter’s picture

subscribe

broncomania’s picture

Is the views integration in progress ? I think this is the biggest advantage of the datatable. It has the capability to replace the standard table in drupal. The datatable library is absolutly amazing but I cant get it really work with views. Specially the server side funtionality.

guybrush’s picture

subscribing

broncomania’s picture

Okay, it looks like nobody else is working on this feature, so i decided to start the development. At the moment i have included the patch from thehong.

I created the a hook menu entry for the server path and the logic for the views requirements. First the views name, display_id, and the args. These informations are submitted thru the path. So every view should later use the datatable without problems.

I got the request now working but I have to solve some problems. One of them is how can I get the total amount of available rows from the view. I see there is an entry in the view object but it is not filled thru this modul. Has any one an idea, maybe the maintainer of this module?

I am also looking for a co maintainer, because I think this code should be shared. At the moment it is not working and I just started to develop so any assistance is welcome.

I added some features from the datatable to extend the usecases, like state save, jquery ui themeroller, server side on/off, pagination on/off, pagination numbers or 2 buttons,...

broncomania’s picture

Category: feature » task
Status: Needs review » Needs work
duellj’s picture

Obviously I haven't had much time to work on this module lately. borcomania or thehong, are either of you interested in becoming co-maintainers of this module? Let me know, and I'd be happy to add you to the maintainers list.

broncomania’s picture

Yeah, I just want to ask u today how to commit here. I finish some development and would like to share this dev status with others for a second view.

I finished the task with ajax requests but there are still some bugs. But it's worth to take a dev look.

Included are localization features, ajax integration (without filter and sorting at the moment) and a Javascript fix for preventing the double initialisation of the datatables.
Missing is the correct implementation of the drupal.attachBehavior. I patch the jquery.datatables.js file for the moment until I found out how to integrate it the correct way. Buggy is also the total number of rows thru the views 3 API.

duellj’s picture

Can you post up a patch so I can take a look, and if it looks good I'll give you commit access.

broncomania’s picture

Sure, I will finish today my task to include the drupal.attachBehavior() then I will make a patch and publish it here.

broncomania’s picture

FileSize
17.39 KB

Okay here is my patch, but the drupal.attachBehavior() is not included yet. To make it work there is also a patch to views 3 nessessary at the moment. This is just for have a look.

The problem with views 3 is that I can#t get the total rows as a part of the view result. There is some further work nessesary.

Edit: In this patch are some files missing. I think I have first to learn how to create a patch and how to include new files. The documentation is really awfull. Maybe you duellj can assist me in this step or give me a hint.

broncomania’s picture

FileSize
9.9 KB

So here is the missing part.

broncomania’s picture

FileSize
302.85 KB

Okay I jut want to drop my latest work here:
This datatables version includes my latest state with the following changes:

  • Internationalization of the datatables module (german)
  • Library support integrated
  • Changed requirement (Shows now the version of the installed datatable library)
  • Datatables enhancements (state safe, drupal.behavior for javascript in the datatable, themeroller support, different pagers,...)
  • Ajax search function
  • Ajax sorting function
  • Ajax paging function

What is not perfect:
The integration with the views 3 module needs until now a small patch to get the total amount of the available rows.

views/plugins/views_plugin_query_default.inc at row 1163
original:

      if ($this->pager->use_pager()) {
        $view->total_rows = $this->pager->get_total_items();
      }

changed views:

      if ($this->pager->use_pager() || $view->get_total_rows) {
        $view->total_rows = $this->pager->get_total_items();
      }

So if someone had a better solution, feel free to leave an update here!

I would also like to get better search support thru the views table class (checkbox search fields in the views admin area).

I think the first step is made to get a better table, but there is really some more know how necessary to make it stable and better.

thehong’s picture

Assigned: thehong » Unassigned
broncomania’s picture

Hmm, I thought there is more interest in this topic?

iancm’s picture

I'm very interested in seeing where this is headed. Will the current patches also work for Drupal 7? I'm particularly after FixedColumns, ColVis plugins.

broncomania’s picture

I would like to open a new development branch with the ajax views integration. For sure its just a beta but somewhere has to start the development. It would be pity if this feature gets lost and I don't think that it is possible to add these features in a submodule. So duellj what do you think?

broncomania’s picture

No, at the moment it's only for d6, but I think with some changes it could be addopted to d7 due to the same version of views (3). I you get it work, it would be nice if you share your code.

duellj’s picture

broncomania, I've opened up a new ajax branch, and have give you write access to the repo. I've committed some code there that starts the process for getting ajax support in D7. Feel free to start hacking against that branch to see if you can get ajax working. Also, if you want to create a new branch for all of your plugin work, that'd be fantastic (it'll be a little bit easier to review).

Thanks again for all your work!

bogtan’s picture

FileSize
1.3 MB

Hi all,

For those who want to use dataTables with server side processing with Drupal 7, I managed to migrate the existing code from D6 to D7. It is also integrated with views exposed form and Twitter Bootstrap.

There is still an issue with sorting the columns (server side, before data is sent to dataTables).

How to use it:

Download the file and untar;
Copy the entire folder to sites/all/modules and enable the module;
Create a view (admin/structure/views/add) and set Display format to dataTables;
In Settings > Pagination and page length check Server side processing of the datatables
In PAGER section of the view set it to Paged output, full pager (10 or how many you want)
Make sure that in your views-view--.tpl.php you remove the $pager variable;

bogtan’s picture

FileSize
1.32 MB

dataTables now supports column sorting and server side free text search in column contents. The search is now supported for EntityReference fields and for FieldCollection items.

duellj’s picture

bogtan,

Thanks for your work! It would be much easier to review and commit your changes if you created a patch (http://drupal.org/node/707484). Thanks!

tanmuhittin’s picture

Issue summary: View changes

When I apply the patch https://www.drupal.org/node/1108532#comment-6692692 ajax pagination is ok but text search and filtering are not working. In text search I got 404 error on console. It is looking for a route

/datatables/viewname/page/?.....

and it is not found. Any idea?

dqd’s picture

Status: Needs work » Closed (won't fix)

Drupal 6 reached EOL and I am sorry for that this issue hasn't been fixe din the life of Drupal 6 Read more about EOL here: https://www.drupal.org/about/drupal6-eol

Will close this with big thanks to all who have worked hard on this and feel free to open a new issue for this purpose on newer versions of this project.