• Resolved groovybanana

    (@groovybanana)


    I have a table that is being used in two different pages. On one page I want the search/filter to search all of the columns and on the other page I want to exclude certain columns from the search. I can achieve the desired result for page two by inserting the following in the custom commands section “columnDefs”: [ { “searchable”: false, “targets”: [ 1, 2, 3, 4 ] } ] but this, of course, has makes it so page no longer works as desired.

    Is it possible to put the above custom command in the shortcode? If not, is there another workaround?

    Thank you for the amazing plugin!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Yes, there is a datatables_custom_commands Shortcode parameter that you could play with:
    [table id=123 datatables_custom_commands="'columnDefs': [ { 'searchable': false, 'targets': [ 1, 2, 3, 4 ] } ]" /]

    I’m not sure if it will work though, as your “Custom Command” contains [ and ] characters – which are also the delimiters for the Shortcode… Unfortunately, I’m not aware of an easy way around this, if this causes a problem.

    Regards,
    Tobias

    Thread Starter groovybanana

    (@groovybanana)

    Thank you for the quick response. Unfortunately, the [ and ] are breaking it so it doesn’t work for me.

    I guess I will have to implement plan B. thank you!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yeah, that’s what I thought, too :-/ Sorry for not having a solution here.

    Regards,
    Tobias

    Thread Starter groovybanana

    (@groovybanana)

    No worries, I found a less elegant workaround that will accomplish the same thing.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    awesome! That’s good to hear! Thanks for the update!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Commands in shortcode?’ is closed to new replies.