New home › Forums › Pro Add-on › Advanced Table – Set Placeholder for Search Input
Tagged: advanced table, input, placeholder, search
- This topic has 5 replies, 3 voices, and was last updated 7 years, 1 month ago by Nick Duncan.
-
AuthorPosts
-
October 10, 2016 at 4:10 pm #21472alza2016Member
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 !
October 14, 2016 at 8:33 am #21528SupportTeamModeratorHi 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.
October 20, 2016 at 7:14 pm #21625alza2016MemberHi 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 ! 😀
October 21, 2016 at 5:54 pm #21642SupportTeamModeratorHi 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?
October 21, 2016 at 7:13 pm #21643alza2016MemberHi 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
October 23, 2016 at 7:49 pm #21655Nick DuncanKeymasterHi 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 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.