Replies: 2 comments 3 replies
-
Hi Jon, Have you tried changing your code to run on any view?
Amanda |
Beta Was this translation helpful? Give feedback.
2 replies
-
Hi Jon, You just need to add the view ID to your jquery selector, this will prevent any other views from being effected:
Do you do this a lot? If so, you could turn it into a function, that excepts the view.key and the placeholder text and then call it where needed. Amanda |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Out of all the great solutions KTL offers, one of my favorite is the keyword for auto refreshing (_ar) a particular view. But one issue that I would like to see if there is a solution for is the following. Using the below code, we have changed the wording on a search field from "search by keyword" to "search by serial number". The problem is, when a user initially opens this particular view, the wording on the search bar is "search by serial number" but because we have the auto refreshing (_ar) set to "quietly" refresh the page every 10 seconds, that the "search by keyword" will replace our custom wording. If user leaves page and comes back to it or if they refresh browser, our custom wording will reappear in the search bar but within 10 seconds be replaced by generic built in wording of "search by keyword"
I'd like to see if there is a way to keep our custom search bar wording regardless of using KTL's auto refresh feature.
Here is the code I used to replace Knacks generic wording in search bar:
$(document).on('knack-scene-render.any', function(event, scene) {
$("input[name='keyword']").attr("placeholder", "search by serial number")
});
Thank you... JON
Beta Was this translation helpful? Give feedback.
All reactions