Hi Team,
I am unable to trigger filter event on focus and arrow key function with empty string. Need to call API call on pressing arrow keys or onfocus
Requirement: User should be able to see autocomplete results with empty string by pressing arrow keys or focusing autocomplete.
{
"CustomerMaster": [
{
"CustomerID": 11718,
"CustomerCode": "0500732349",
"CustomerName": "SHREE SHRIJI NASTA HOUSE",
"CustomerNameCode": "SHREE SHRIJI NASTA HOUSE (0500732349)",
"CustomerPaymentType": 1,
"SalesMode": 0,
"PromotionControl": "1",
"CustomerState": 12,
"DistributorState": 1,
"CustomerStateType": 0,
"DistributorStateType": 0,
"BillToCustomer": ""
},
{
"CustomerID": 11730,
"CustomerCode": "0500733131",
"CustomerName": "SHIVAM DAIRY",
"CustomerNameCode": "SHIVAM DAIRY (0500733131)",
"CustomerPaymentType": 1,
"SalesMode": 1,
"PromotionControl": "1",
"CustomerState": 12,
"DistributorState": 1,
"CustomerStateType": 0,
"DistributorStateType": 0,
"BillToCustomer": ""
}
]
}
|
onFocus: function (args) {
this.$refs.autoComplete.ej2Instances.searchLists(args.event);
},
|
Hi Sevvandhi,
Thanks for you reply. Changed to same method on focus event. It worked.
How to show list of results on focus? before user press arrow keys
|
onFocus: function(args)
{
if ( this.$refs.autoComplete.ej2Instances.value == "" || this.$refs.autoComplete.ej2Instances.value == null ) {
this.$refs.autoComplete.ej2Instances.showPopup();
} else
{
this.$refs.autoComplete.ej2Instances.searchLists(args.event);
}
} |