var Input_ItemInfo_Manufacturer = new AW.UI.Combo;
Input_ItemInfo_Manufacturer.setId("Input_ItemInfo_Manufacturer");
Input_ItemInfo_Manufacturer.setEvent("onkeyup", autoCompleteCombo);
Input_ItemInfo_Manufacturer.setItemText(Manufacturers_List_Arr);
Input_ItemInfo_Manufacturer.setItemCount(Manufacturers_List_Arr.length);
Input_ItemInfo_Manufacturer.getPopupTemplate().setStyle("width","295px");
document.write(Input_ItemInfo_Manufacturer);
var BASE_UNITS_LIST = new AW.UI.List;
//BASE_UNITS_LIST_ARR is defined elsewhere, but it's a 1D array
BASE_UNITS_LIST.setItemText(BASE_UNITS_LIST_ARR);
BASE_UNITS_LIST.setItemCount(BASE_UNITS_LIST_ARR.length);
var Grid_Items_Items = new AW.UI.Grid;
Grid_Items_Items.setId("Grid_Items_Items");
Grid_Items_Items.setHeaderText(Headings_Items_Items);
Grid_Items_Items.setColumnCount(Headings_Items_Items.length);
Grid_Items_Items.setCellEditable(true);
Grid_Items_Items.setCellTemplate(new AW.Templates.Checkbox,11);
Grid_Items_Items.setHeaderTooltip("Taxable",11);
Grid_Items_Items.setCellTemplate(new AW.Templates.Combo,3);
Grid_Items_Items.getCellTemplate(3).setEvent("onkeyup",autoCompleteCombo);
Grid_Items_Items.setPopupTemplate(BASE_UNITS_LIST,3);
Grid_Items_Items.getPopupTemplate(3).setStyle("width", "40px");
function autoCompleteCombo(event){var key=String.fromCharCode(event.keyCode || event.charCode);switch (event.keyCode) {case 38:case 40:case 37:case 39:case 33:case 34:case 36:case 35:case 13:case 9:case 27:case 16:case 17:case 18:case 20:case 8:case 46:return;break;};var list;if(typeof(this.getItemCount)=='undefined'){list=this.getPopupTemplate();}else{list=this;}var tbox=this.getContent("box/text").element();var tboxValue=tbox.value;var i;var found=false;for(i=0;i<list.getItemCount();i++){if(list.getItemText(i).toUpperCase().indexOf(tboxValue.toUpperCase())==0){found=true;break;}}var iLen = tbox.value.length;if(found){tbox.value = list.getItemText(i);list.setCurrentItem(i);}else{tbox.value = '';}if(tbox.setSelectionRange) {tbox.setSelectionRange(iLen, tbox.value.length);} else {var oRange = tbox.createTextRange();oRange.moveStart("character", iLen);oRange.moveEnd("character", tbox.value.length-iLen);oRange.select();}return;};
var tbox = this.getContent("box/text").element();
var tboxValue = tbox.value;
function autoCompleteCombo(event)
{
var key = String.fromCharCode(event.keyCode || event.charCode);
switch (event.keyCode)
{
case 38:
case 40:
case 37:
case 39:
case 33:
case 34:
case 36:
case 35:
case 13:
case 9:
case 27:
case 16:
case 17:
case 18:
case 20:
case 8:
case 46:
return;
break;
};
var list;
if(typeof(this.getItemCount) == 'undefined')
{
list = this.getPopupTemplate();
}
else
{
list = this;
}
var tbox = this.getContent("box/text").element();
var tboxValue = tbox.value;
alert(tbox.value);
var i;
var found = false;
for(i = 0; i < list.getItemCount(); i++)
{
if(list.getItemText(i).toUpperCase().indexOf(tboxValue.toUpperCase()) == 0)
{
found = true;
break;
}
}
var iLen = tbox.value.length;
if(found)
{
tbox.value = list.getItemText(i);
list.setCurrentItem(i);
}
else
{
tbox.value = '';
}
if(tbox.setSelectionRange)
{
tbox.setSelectionRange(iLen, tbox.value.length);
}
else
{
var oRange = tbox.createTextRange();
oRange.moveStart("character", iLen);
oRange.moveEnd("character", tbox.value.length-iLen);
oRange.select();
}
return;
};
function autoCompleteCombo(event)
{
var key = String.fromCharCode(event.keyCode || event.charCode);
switch (event.keyCode)
{
case 38:
case 40:
case 37:
case 39:
case 33:
case 34:
case 36:
case 35:
case 13:
case 9:
case 27:
case 16:
case 17:
case 18:
case 20:
case 8:
case 46:
return;
break;
};
var list;
if(typeof(this.getItemCount) == 'undefined')
{
list = this.getPopupTemplate();
}
else
{
list = this;
}
var tbox = this.getContent("box/text").element();
var tboxValue = tbox.value;
var i;
var found = false;
for(i = 0; i < list.getItemCount(); i++)
{
if(list.getItemText(i).toUpperCase().indexOf(tboxValue.toUpperCase()) == 0)
{
found = true;
break;
}
}
var iLen = tbox.value.length;
if(found)
{
tbox.value = list.getItemText(i);
list.setCurrentItem(i);
}
else
{
tbox.value = '';
}
if(tbox.setSelectionRange)
{
tbox.setSelectionRange(iLen, tbox.value.length);
}
else
{
var oRange = tbox.createTextRange();
oRange.moveStart("character", iLen);
oRange.moveEnd("character", tbox.value.length-iLen);
oRange.select();
}
return;
};
This topic is archived.