• Resolved nickgill

    (@nickgill)


    Hi there; fantastic work, and thanks so much for the plugin. I’m afraid I have a daft question about using Datatables options with shortcodes.

    I’m trying to disable the option to sort column 1; the Datatables reference gives …

    $(‘#example’).dataTable( {
    “columnDefs”: [
    { “orderable”: false, “targets”: 0 }
    ]
    } );

    … which I’ve tried to do as a shortcode as follows, which doesn’t work …

    … datatables_columnDefs=’%5B “orderable”: false, “targets”: 0 %5D’ …

    I’m doing something stupid, aren’t I?

    https://ww.wp.xz.cn/plugins/inline-google-spreadsheet-viewer/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Meitar

    (@meitar)

    I’m doing something stupid, aren’t I?

    Lol, 🙂 kinda but thousands of times less stupid because at least you’ve acknowledged that’s a likely cause, cheering my day, which is usually filled with far more stupid things, so thanks.

    Take a closer look at the docs. There’s no datatables_columnDefs attribute. It’s datatables_column_defs. 😉

    Also your value is invalid; you are missing curly brackets!

    Thread Starter nickgill

    (@nickgill)

    Man, I have to admire your speed of reply, especially to someone who’s cocked it up quite so badly.

    I had the curly brackets, you know? I really did. And then I got rid of them.

    Thanks for your help; you’re a gent.

    n

    Plugin Author Meitar

    (@meitar)

    Thanks. The real answer is to make a UI so that humans don’t have to worry about whether there is a curly bracket in the right place. That’s just ridiculous. But that’s boring for me to code, so I haven’t done it. Maybe I will, or maybe someone else will do it and submit a patch. *shrug*

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Datatables shortcodes’ is closed to new replies.