⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Is it posible to use the ColVis extra en Datatables?



edgarvaldes
  • profile picture
  • Member

Posted 07 June 2013 - 16:05 PM

Iḿ talking about this:

http://www.datatables.net/extras/colvis/

 

DataTables in GroceryCrud uses the TableTools "extra", but don't include ColVis by default.

 

The  initialisation example don't work at all:

 

"sDom": 'C<"clear">lfrtip'

 

Is this a problem wih the version of Datatables.js used in Grocery Crud?

 

 


davidoster
  • profile picture
  • Member

Posted 09 June 2013 - 06:09 AM

Hello [member=edgarvaldes].

Thank you for this. I confirm that ColVis doesn't work with version 1.3.3 of Grocery CRUD.

I am looking into it and I will let you know.


davidoster
  • profile picture
  • Member

Posted 09 June 2013 - 06:38 AM

Update: I confirm it works!

Steps,

 

1. download the ColVis extra from here, http://www.datatables.net/extras/

2. paste the extra under assets/grocery_crud/themes/datatables/extras

3. rename the folder to ColVis

4. under assets/grocery_crud/themes/datatables/js open the file datatables.js and replace 

   this line  : "sDom": 'T<"clear"><"H"lfr>t<"F"ip>',

   with this : "sDom": 'CT<"clear"><"H"lfr>t<"F"ip>',

5. under assets/grocery_crud/themes/datatables/views open the file list_template.php and add these two lines at the top

$this->set_css($this->default_theme_path.'/datatables/extras/ColVis/media/css/ColVis.css');

$this->set_js($this->default_theme_path.'/datatables/extras/ColVis/media/js/ColVis.min.js');

so it looks like this

yjouNei.png

 

6. Enjoy! http://eletter.gr/samples/gc_ic/index.php/gc_examples/employees_management


edgarvaldes
  • profile picture
  • Member

Posted 13 June 2013 - 16:29 PM

Hey, this is great! I can't test it right now but I really appreciate your work.

 

EDIT: Tested and working great!


mosenturm
  • profile picture
  • Member

Posted 10 June 2016 - 13:33 PM

Hi,

 

I've tested ColVis 1.10 like above. But I can't see any button an my page. ColVis css and js are loaded. datatables.js is changed for ColVis. Any thoughts?

 

Thanks in advance for help!

Andreas