Advanced Table – Set Placeholder for Search Input

New home Forums Pro Add-on Advanced Table – Set Placeholder for Search Input

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21472
    alza2016
    Member

    Hi,

    When I use the advanced table, how can I set a Placeholder for the Input Search ? (class=”dataTables_filter”)

    I tried to localize it in the .php files of pro and regular version, I did not find.

    Thanks for your help !

    #21528
    SupportTeam
    Moderator

    Hi there,

    This is an option from dataTables and as such there is no way to change it in our plugin. However, it is possible to change this in the code of the plugin, however, please note that changing the code of the plugin is not protected when updating the plugin, so you will have to change the code again after each update, or not update your plugin on your site.

    Are you comfortable with this? If so, please get back to me and I will try to help as best I can.

    #21625
    alza2016
    Member

    Hi Nathan,

    thanks for your feedback. Yes, I can handle that, just tell me where to change it in the code and it will be perfect ! 😀

    #21642
    SupportTeam
    Moderator

    Hi there,

    I have spoken to the developers and they have said that adding this jQuery into the Pro->core.js file under the ready function (about line 827) should allow for the placeholder to change –

    jQuery(".dataTables_filter").attr("placeholder", "CHANGE THIS TO WHAT YOU NEED TO SAY");

    Please let me know if this helps at all?

    #21643
    alza2016
    Member

    Hi Nathan,

    Thanks for your feedback

    I tried to add the code around line 827, nothing happened. (I also reloaded the map)

    We agree it’s still inside the ready function (before it’s end, line 1066?)

    I also tried this:
    jQuery(“.dataTables_filter input”).attr(“placeholder”, “THIS TEXT IS THE PLACEHOLDER”).val(“”).focus().blur();

    Nothing changed :s

    #21655
    Nick Duncan
    Keymaster

    Hi there

    Please open the core.js file and go all the way to the bottom, then add the following:

    jQuery(document).on( 'init.dt', function () {
        jQuery('div.dataTables_filter input').attr('placeholder', 'customer placeholder text'); 
    });

    Make sure your force a refresh of the JS file in your browser 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.