Dynamic Auto Complete with UDF
Posted: Tue Oct 16, 2018 12:27 pm
I'm trying to add dynamic auto complete to a text box.
I created a UDF that accepts two parameters. I added this code to the onkeyup event of the text box.
If I plug the URL into a browser I get the following JSON, which i verified correct using JSONLINT.
However, when I run the program, it doesn't seem that the code is firing.
Can I do this like this, or should I be using some other method?
I created a UDF that accepts two parameters. I added this code to the onkeyup event of the text box.
Code: Select all
debugger;
var loc = get("ddLocation");
var chars = get("txtItemLookup");
var url = "http://myIBMI:8080/profoundui/universal/getTransferItems?chars=" +
encodeURIComponent(chars) + "&loc=" +
encodeURIComponent(loc);
applyProperty("txtItemLookup","choices url", url);
applyProperty("txtItemLookup","field type","textbox");
Code: Select all
{
"success": true,
"response": {
"colWidths": [13,
30],
"results": [{
"item": "998300",
"desc": "TOYOTA MULTI 2000 & UP S/DDIN"
},
{
"item": "90580",
"desc": "EARPLUGS,4PR,DISPOSABLE"
},
{
"item": "993304",
"desc": "BUICK TERRAZA,SATURN RELAY,PON"
},
{
"item": "911R",
"desc": "FIRST ALERT, BATTERY OPERATED"
},
{
"item": "90716",
"desc": "3M TEKKPROTECT REUSE CORDED EA"
}]
}
}
Can I do this like this, or should I be using some other method?