Forum Discussion
ChayceDuncan2
7 years agoQrew Cadet
So out of the box it would likely be a good feature enhancement, but currently there is nothing in the settings that has that as a feature. That said - if you're familiar with the Image Onload Technique and feel comfortable with scripting techniques, you could run a script with IOL that dynamically adds HTML to the page when it loads, and then add your own Javascript into the element to achieve the functionality you want. Credit to the link below for the building block behind it.
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=582&_ga=2.54479343.670650234...
With that - you can run a code page that does something like:
This will add a search box next to the save button - all you would have to do is configure the searchCustomer() function in your code page and you'd be all set.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=582&_ga=2.54479343.670650234...
With that - you can run a code page that does something like:
var input_html = "<input id='customer' type='text' placeholder='Search Customer #' style='border-radius:2px;height:25px;font-size: 12pt'>";Looks something like this when complete
input_html += "<span style='cursor:pointer;margin-right: 25px' onclick='searchCustomers()' class='BrandBarIconDark Find DisplayInlineBlock WithText'></span>"
$("#pageNavBarActions").prepend(input_html)
This will add a search box next to the save button - all you would have to do is configure the searchCustomer() function in your code page and you'd be all set.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
- ChrisNewsome7 years agoQrew Captainthis is exactly what I wanted, but I have no idea about IOL. If you can give me an of how to pull that off, I'll look into it.
- ChayceDuncan27 years agoQrew CadetSo this link here: https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=582&_ga=2.147307188.2014909509.1553519734-272478357.1552062926
Shows you the code of embedding IOL in the branding element. To do it - open the Settings > Branding Page in your app, open your dev console in your browser - and then copy and paste the code to turn IOL on from that link, then hit enter.
When its enabled - it basically means that any time your application loads it will try and run your script since the branding element is always present.
The example code references a page called moduleBOL.js - so the last step is to also create a Quick Base code page (similar to a home page - but code based). Thats where you'll actually embed all your code to build your search button. You can try and do the standard console.log("hello world"); in the code page and watch the console to see if it came together.
Hopefully that gets you started. Feel free to shoot me an email and I can give you more info / send more screenshots or code snippets
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - EOMDevelepors7 years agoQrew CaptainI set this up. I like it. I need some help setting up the searchCustomer() function.
Can you help please.
Thanks - ChayceDuncan27 years agoQrew CadetThe answer depends on what you're trying to accomplish. Are you hoping that if you find an exact match to your search that it opens it up the form view? Or are you just trying to do a search similar to the normal table search that it shows all the match in a list view?
- EOMDevelepors7 years agoQrew CaptainI guess whichever one is easier. Just trying to explore options for my app.
Thanks - ChayceDuncan27 years agoQrew CadetTo give context - what I've done in this past is:
User enters their search and hits enter -
First - do an API_DoQuery against a certain field (like customer name)
If an exact match is found - meaning I only return one record, I take the user directly to that form.
Else -
if I find more than one option for that search, or don't find an exact match for what they entered, I redirect the user to the new report page querying using basic QB query syntax for their search.
If you are searching something like a company name - your best bet will be to just stick with the second item from above. You'll very rarely hit an exact match on things like names - so it'll be easier to just mimic a regular table search.
To do that - in your search() function - a simple solution is just to do something like:var fid = enter the field you want to search here
Basically your search box just takes in your entry and goes to a new page with that search box already filled in as your query.
var search = input your user types into your search box
window.location = "https://realm.quickbase.com/tableDBID?a=q&query={'"; + fid + "'.CT.'" + search + "'}"
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - EOMDevelepors7 years agoQrew CaptainOk will play around with it and hopefully put together something.
Thanks for your help.
I don't know if you are following the BOL post but I needed to put in the custom branding which was taken away after using the BOL method.
So I added these few lines to add the custom logo back:
var header = document.getElementById("customBrandBar").tBodies[0]; //get the tbody element
//this line is optional if you want to change the background color.header.style.backgroundColor = "red";
var tr = header.childNodes[0];
var td = tr.childNodes[1];
var img=document.createElement('img');
img.src="the logo url";
//this line is optional if you want to resize the image
img.style.height = '7%';
td.appendChild(img); - ChrisNewsome7 years agoQrew CaptainI will try to set aside some time for this. I think it needs to be a feature enhancement ultimately, so I may post that as a request as well.
- ChrisNewsome7 years agoQrew CaptainI will try to set aside some time for this. I think it needs to be a feature enhancement ultimately, so I may post that as a request as well.