Hi! I am trying to do a simple app with some information. I want to use InputField and Search button to let user to search in the topics list for the interesting issue. For example, there will be about 30 different topics and I want to find something about lake. So, in the InputField I’m writing “lake” and it should find something about it from the list of 30 elements. And when I can see the result displayed below and I can press it to change the scene.
Do you know how to make such a search?
Do you know any free/not free (but cheap;)) asset for search in the app?
You aee looking for some sort of custom control that provides a search field (with autocomplete support?) button and a list view.
I am not familiar with an asset that does this, but it should be fairly simple to write it yourself.
I am learning javascript but it’s too early for me to write such a script. That’s why I am looking for some asset.
Ok, I found something but it is a search for a web page. So, I need to adapt it to the Unity, what meens change HTML reference to Unity reference.
My table will looks like that:
var products = new Array(“Element”,“Product”,“Thing”,“Object”);
For example: this is a code for displaying information after search.
for ( var i = 0; i < rows.length; i++ ) {
var fullname = rows[i].getElementsByTagName("td"); //So, it referes to the table, made with browser coding with <td> <tr> etc. How can I make it refere to the table?
fullname = fullname[0].innerHTML.toLowerCase();
if ( fullname ) {
if ( v.length == 0 || (v.length < 3 && fullname.indexOf(v) == 0) || (v.length >= 3 && fullname.indexOf(v) > -1 ) ) {
rows[i].style.display = "";
on++;
} else {
rows[i].style.display = "none";
}
}
}
So, I will need something like that:
function printResults(sortedResults) {
var outputArea = document.getElementById(“inputField”);
outputArea.innerHTML=“”; - and here is reference to the HTML file. Can U tell me how to let it reference to the inputField?