• Resolved X-Raym

    (@x-raym)


    Hi!

    How would you install DataTables extensions, such as Responsive ?

    I know to enqueue JS, and CSS, I’m just stucj with the jquery part;

    $(document).ready(function() {
        $('#key').DataTable( {
            responsive: true
        } );
    } );

    I saw on other support thread that the code provided by the databales cannot work out of the box, it has to be in this way:

    jQuery(window).load(function () {
        jQuery('#igsv-key').dataTable().api().page.len(-1).draw();
    });

    Do you confirm ?
    How would you integrate this ?

    Thanks for your support!

    https://wordpress.org/plugins/inline-google-spreadsheet-viewer/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter X-Raym

    (@x-raym)

    Maybe do you plan to integrate the extension in the future ?

    Plugin Author Meitar

    (@meitar)

    Adding Responsive to the plugin by default sounds like a really good idea, although that’s not been done yet. Thank you for the suggestion. 🙂

    For now, if you want to define your own DataTables plugins, you will need to reinitialize the DataTable object itself; you can’t reinitialize a DataTable once it’s already been created. That’s why the difference between the two constructors in the examples. So this is not actually a Inline Google Spreadsheet Viewer question, it’s more about how to use the DataTables API. For that, I refer you to the DataTables API reference manual.

    Thread Starter X-Raym

    (@x-raym)

    Thank you for your quick answer and your advices!

    Unfortunately, I tried during hours, and I have to admit that this is not a “simple jquery plugin”, it possibly the most complicated I ever see!
    I tried to set datatables on/off in the wordpress shortcode, I tried different integrations, I read threads in the forum…
    There is a lot of documentation it’s true but I don’t have the level in jQuery to fully understand it -aka, to make it work.

    I will probably wait for an integration in your plugin…

    Good luck! 🙂

    Thread Starter X-Raym

    (@x-raym)

    Thank you so much for the responsive class ! 🙂 🙂

    Thread Starter X-Raym

    (@x-raym)

    I hope it wasn’t too hard to implement!

    Do you plan to add other extensions ?

    Fixed Header is a good candidate for me 🙂

    Plugin Author Meitar

    (@meitar)

    🙂 No, it was not hard to implement.

    I can add other extensions but only if it makes sense to do so for most people who use the plugin. The best way to suggest new features is to make a new thread and suggest a feature there, that way I can quickly guage how many people are asking for a specific feature.

    You can also add the FixedHeader extension yourself in the same way as I’ve described adding other extensions, above.

    Thread Starter X-Raym

    (@x-raym)

    Ok I will open new thready if I feel any specials need 🙂
    —-
    About the responsive addons,
    there is some kind of interaction between it and the Hide/show columns functions.
    Here is a screenshot.
    As you can see, the hide/show isn’t effective at all.

    Is that a problem related to DataTables itself ?

    Thanks again for your support!

    Plugin Author Meitar

    (@meitar)

    Responsive hides and shows columns based on available width, so it overrides settings in Show/Hide columns when it needs to (which it does if the table is too wide for its space). Use the DataTables API to customize either extension’s behavior.

    Thread Starter X-Raym

    (@x-raym)

    Thank you again for your quick support 🙂

    Thread Starter X-Raym

    (@x-raym)

    Just noticed that the with of the table have to be reset (something like table.dataTable {width:100%!important;}, if no, you will see an horizontal scrollbar at the bottom, and some columns will not be “horizontal”.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Installing DataTable Extensions’ is closed to new replies.