• Resolved Andrzej_K

    (@andrzej_k)


    Hi!

    First of all – thanks for that great plugin. I use it a lot and I can say – there is no better one for tables in WP.

    Now I need to add some extras to one of my tables but I get stuck.
    I can’t target label or input with jQuery.

    Could You tell how to do it?

    I will be very greatful.

    Best regards,
    Andrew

    https://ww.wp.xz.cn/plugins/tablepress/

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.

    Can you please be more specific here? What exactly are you trying to do? What code have you tried?

    Regards,
    Tobias

    Thread Starter Andrzej_K

    (@andrzej_k)

    Hi!
    I’ve made a simple table with Your plugin. And there I want to add a function to click satment of input bar at search bar.

    Like always I’ve tried to target it with jQuery by
    $(‘#name’) – in this case that’ll be $(‘#tablepress-1_filter’) but it doesn’t get anything. Same like $(‘input’) or $(‘label’)…

    I can target whole table with it id but no elements from searchbar.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    your code is probably running too early, i.e. when those elements are not yet in the page (they are also added with JavaScript by the DataTables JS library).

    The best way probably is to perform your actions in the initComplete hook, in a “Custom Command” on the table’s “Edit” screen:

    "initComplete": function() { $('#tablepress-1_filter').... }

    (Note that all code in the “Custom Commands” must be in one line of text.

    Regards,
    Tobias

    Thread Starter Andrzej_K

    (@andrzej_k)

    Tobias – I’m so glad that I’ll hug You if that will be possible. 😉
    Thank You very much! Once again: great plugin and great Author/support.

    Best regards,
    Andrew

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

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

The topic ‘Target label or input with jQuery’ is closed to new replies.