- Home /
Question by
jonander · Feb 17, 2017 at 09:12 AM ·
arraydatabaseinputfieldsearch
Create a Searcher To find [n] Text's (results) of Array[n]
Hello again community!
I've a new question about searching results. I need to create a "Finder" to search (string) result.. i mean..
I wan't to insert some "value" at the InputField and filter the result of the string Array, Items[n]
Yes, my first intention was to read all that Array and Hide all of those value that doesn't Contain [InputField]Value like http://answers.unity3d.com/questions/1164264/how-do-i-display-search-results-using-input-fields.html but..
My array list is something like: (Reads all the DataBase content and then I separate..)
And I Use \script/ to separate all the String[n] info to take the values.
public IEnumerator Start ()
{
WWW Matprim= new WWW ("http://localhost/inventario_iraule/Leer_Stock_MatPrim.php");
yield return Matprim;
string itemsDataString = Matprim.text;
items = itemsDataString.Split (';');
for (int i = 0; i < items.Length; i++)
{
GameObject nuevaFila = Instantiate (PanelFilas) as GameObject;
nuevaFila.transform.SetParent(PanelPrueba);
UD.text = GetDataValue(items[i], "UD:");
UD.name = ("ud_") + (GetDataValue(items[i], "Descripcion:"));
Descripcion.text = GetDataValue(items[i], "Descripcion:");
Descripcion.name = ("desc_") + (GetDataValue(items[i], "Descripcion:"));
Cantidad.text = GetDataValue(items[i], "Cantidad:");
Cantidad.name = ("cant_") + (GetDataValue(items[i], "Descripcion:"));
}
}
string GetDataValue(string data, string index)
{
string value = data.Substring (data.IndexOf (index) + index.Length);
if(value.Contains("|"))value = value.Remove (value.IndexOf ("|"));
return value;
}
I'm a little lost, If you can help me I'd be so happy :)) Sorry again for my low English!
muestra.png
(152.2 kB)
muestra2.png
(247.6 kB)
Comment