Hello,
Datatables version 1.10.16 change structure (file's name and extensions) i port form version 1.10.13
fix some bug.

1/ download datatable and all extension at https://datatables.net/download/index
2/ extract to sites/all/libraries/datatables
lib
(removes folder themes Bootstrap-3.3.7 if it generate )
3/ active extension in views
views
some extension can customisable view exemple here https://datatables.net/extensions/index
some issue i can't fixe state_save + multi filters right now
4/ support search api and elasticsearch

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lazzyvn created an issue. See original summary.

adpo’s picture

I tried this method but it doesn't work. Form the console log I can read the file from sites/all/libraries/datatables-1.10.16 can be loaded.

How can I change it so the system will be looking for the correct location ( sites/all/libraries/datatables).

Also the search box is not displayed when using datatables-1.10.13 with your previous patch. What is the reason? (no error logs in the console)

PS. I'm using jquery 1.10

Thank you for reply.

lazzyvn’s picture

if you want load sites/all/libraries/datatables/datatables.js just delete folder DataTables-1.10.16. For update newest version i think easier download from https://datatables.net/download/index than custom libraries
I dont have any problem with search may be your configuration is not correct
ps: big difference between some version 1.9 it call object datatables but > 1.10.13 it call Datatables you can use console log debug datatables or Datatables sometime extension doesn't because of object datatables

lazzyvn’s picture

FileSize
68.65 KB

instruction:
- download and active module datatables version dev 1.x
- download libary datatables custom https://datatables.net/download/index extract to sites/all/libraries/datatables
dont forget to clear the cache.
next patch i will update datatables in search_api with elasticsearch connector version 5. actually datatables works fine with ajax but it isn't top performance so that's why we need call directly from elasticsearch

lazzyvn’s picture

Issue summary: View changes
FileSize
67.66 KB
philltran’s picture

Hi @lazzyvn

Thanks for the patch. It applied cleanly to the 7.x-1.x-dev, but not the 7.x-2.x version of the module.

Which version of the module does this issue apply? It is marked for 7.x-2.x.

philltran’s picture

FileSize
68.89 KB

I rolled a patch for 7.x-2.x-dev based on your work.

change2lives’s picture

I followed all the steps and can't get the sites/all/libraries/datatables to load. Any suggestions?

lazzyvn’s picture

hi 1st version i make for version 7.2 but it is still alots of bug (in my project). so that's why i make another patch for 7.x-1.x it's more stable than 7.x-2.x i post new patch for 7.x-1.x (next week if i have time i will fix some bug for paging + total from return json) this new patch will support ajax serverside for large data and also views search api + elasticsearch connector

philltran’s picture

@9lazzyvn Okay. Let me know if you need help with anything.

lazzyvn’s picture

@philtran I have 20k rows in my database + elasticsearch, i wanna use search api views to shows all my data with datatables and multi filter for every column . but with large data it can't show all data in one time (5minus to load). I think there is 2 ways:
- use query directly to elasticsearch but i got problem of cross domain elasticsearch run at localhost:9200
- use server side it works in my new patch but it's not stable and i dont know how to get total record. if you have time can you test it please

adamtong’s picture

#7 patch is working in the 7.x-2.x-dev, however, the boostrap4 style is not here in views for selection.

adamtong’s picture

FileSize
216.26 KB

I added the boostrap4 in option

$form['elements']['style'] = array(
      '#type' => 'select',
      '#title' => t('Theme Style'),
      '#default_value' => isset($this->options['elements']['style']) ? $this->options['elements']['style'] : 'jquery.dataTables',
      '#options' => array(
        'jquery.dataTables' => t('(Default)'),
        'bootstrap' => t('Bootstrap 3'),
        'bootstrap4' => t('Bootstrap 4'),
        'foundation' => t('Foundation'),
        'jqueryui' => t('jQuery UI'),
        'material' => t('Material'),
        'semanticui' => t('Semantic UI'),
        'uikit' => t('UI Kit'),

      ),

and also update the line like:

':input[name="style_options[elements][style]"]' => array('value' => 'bootstrap4'),

However, i found it will load both the default style and bootstap 4, which make the look is strange.

lazzyvn’s picture

@adamtong
i see your photo there is 2 times sort icon, that means your module load 2 css datatable.css and datatable.bootstrap.css. I fix this bug in #9 can you use version 1.x and apply this patch.
I don't add bootstrap 4 because theme base bootstrap is not support version 4.

lazzyvn’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

Change version 7.x 1x-dev

adamtong’s picture

@lazzyvn

I see, but i am using 7.x-2.x-dev and i have developed my own theme based on bootstrap4, and i have fixed the bootstrap support too.

BUT the patch in #9 is for 7.x 1x-dev which i tried and missing some features in dataTables.js version 1.10.16

Seems 7.x-2.x-dev is better and I am using it without any problem so far.

dqd’s picture

@lazzyvn: a lot work, you've done here and in some other issues regarding updating to the latest DataTable version. 1+ for that, if nobody told you already.

I would love to see you in the D8 issues (D8 adaption movement) ... :)

lazzyvn’s picture

FileSize
72.68 KB

I make new patch for version 1.10.19
fix some bug
- show Button export excel, pdf
- Multi-filter in header with Responsive plugin
- sort with number (int and float) (working for short date but it's so complicated)

dqd’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Priority: Major » Normal
Status: Needs review » Needs work

@lazzyvn: Sorry, but can you please reroll lagainst latest 7.x 2.x dev and split up features here? This issue should only be for new version implementation code, not for additional features (needs new issue for error backtracking). And I would love to see this for D8 1.x too.

Thanks for all your hard work on this.

lazzyvn’s picture

FileSize
27.4 KB

I zip module in my current project, can you do it?
It takes alots of time to find diff 2.x between 2 branches

dqd’s picture

Status: Needs work » Closed (duplicate)

Close this in favour of the new META issue to merge forces: #2999400: [META] Keep track of DataTables library versions an its move away from jQuery Please let's keep track of the DataTables plugin updates in one META issue to prevent clutter.

lazzyvn’s picture

Status: Closed (duplicate) » Needs review

I think will create new module full support datatables because this module is only show basic datatables. If we have to wait approuval for each function it will take alots of time. Another dev will need more features
i plan to support custom theme datatables, field collection table, paragraphs tables, field group table...
Sorry to misunderstood

dqd’s picture

Status: Needs review » Closed (duplicate)

If we have to wait approuval for each function it will take alots of time.

This is called tracking of the further development and is required to tackle down issues on a later spot. And there is no RTBC or anthing you have to wait for. The module has active maintainers and I have commented on your code already and it still needs work. I am willing to commit any new feature as long as it follows the coding and issue standarts of Drupal.org and has no flaws - This is what the other maintainers are awaiting of me in cooperation of the contrib area and I can't break the rules we all have agreed to.

I think will create new module

I fully understand if you want to create an own custom module without the buerocracy of the issue tracker and community testing for your individual needs. And I feel sorry for all the work you have done which could be very helpful for this project. But we can't do it the way a few users may want it here apart from how this issue tracker works. And this custom code should not be placed in this issue queue here. This issue queue belongs to this module project code base only. Sorry and thanks for understanding.

But I would really rather like to encourage you to join and to provide correctly seperated git patches like documented in the Drupal docs of each project (tabs on project pages) and to come over to the right issues for each step to make this module shine in future. You will profit from it too, since you can use your code in conjunction with community testing and improvements of others and with maybe new parts where other developers can chime in to help. This is why the issue queue is structured like it is. This way it is much easier for others to chime in and to help.