JQueryUI and ColVis

JQueryUI and ColVis

neburtonneburton Posts: 63Questions: 6Answers: 0

The example at http://www.datatables.net/release-datatables/extensions/ColVis/examples/jqueryui.html does not seem to render correctly. The show/hide columns does not hide and has a transparent background. I'm sure you are aware of this, but just wondering if there is a timescale for looking at this?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    Answer ✓

    Actually, I just committed a fix for this yesterday.

    The example will be updated on the next ColVis release, but the fix is to just use the jQueryUI option in DataTables at the moment (it is deprecated in 1.10, and will be removed in 1.11, but ColVis isn't capable of working with jQuery UI without that parameter yet).

    Regards,
    Allan

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    Thanks.

    Any timescales on the next release of ColVis? I know how all consuming this project must be and I'm guessing it'll be a case of it'll be released when you get round to it!

    Appreciating your efforts :)

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    Having implemented the above, it seems there is still an issue with the Column Selector not hiding. The Show/hide columns is rendered with JQueryUI styles, and the checkboxes appear when clicked, but do not dissapear when clicked again.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    I'm guessing it'll be a case of it'll be released when you get round to it!

    Mainly it is a case of a release will occur where there are enough bug fixes, or an important / big enough feature is added to warrant a release.

    At the moment there has only been once fix to ColVis core since v1.1.1 (which was for defaults being set with camelCase notation). The fix here is to the example and didn't require any change in ColVis core, so that wouldn't cause a release itself.

    but do not dissapear when clicked again.

    Is that not the default behaviour of ColVis you are seeing (example)? The list isn't removed when a single column is toggled - you need to click outside of the list.

    Allan

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    Clicking outside does not close the list. Doesn't work on this page either http://datatables.net/release-datatables/extensions/ColVis/examples/jqueryui.html

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Right enough - that's a bug. I'll try to look into it tomorrow.

    Allan

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    Brilliant, thanks. Just keen to use ColVis on my app rewrite rather than the ColVis predecessor you helped me create a couple of years ago, that is quite inelegant in comparison!

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Hah - how time flies!

    Fix now committed. If you grab the latest CSS from the repo it should work as expected.

    Allan

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    All working and looking really good. Thanks!

    One further question if I may.... how do you change the button text using the API? It hints that you can on this page : https://datatables.net/extensions/colvis/api but the example doesn't seem to include buttonText. I've tried a few guesses without luck.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    You can't change the button text via the API at the moment - it can only be done at initialisation time. That is done with the buttonText option.

    Allan

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    Can you mix and match these two systems? I'm using the API to add ColVis to the datatable. If I include the following :

    mydatatable = $('#mydatatable ').DataTable( 
    {
    "colVis": 
    {
    "exclude": [0],
    "buttonText": "columns"
     },
    //snip
    

    My datatable still shows the default button text and the column I want to exlude is not excluded.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    Answer ✓

    If you are using the new constructor method to create the ColVis instance, then no, ColVis will not read the options from the DataTables settings object, but you can use all of the same options by passing them in as the second option to the ColVis constructor:

    var colvis = new $.fn.dataTable.ColVis( table, {
      buttonText: "Hi!"
    } );
    

    I'll clarify that in the documentation.

    Allan

  • neburtonneburton Posts: 63Questions: 6Answers: 0

    Brilliant, all working thanks. Sorry if I've distracted you from more pressing development over the last week!

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    No - its good to get this stuff sorted. I'd rather the software that shipped was as bug free as possible! I very much appreciate your feedback!

    Allan

This discussion has been closed.