|
onclick: function() {
// get the typed characters
var dropdownInstance = document.getElementById("country").ej2_instances[0];
this.customValue = dropdownInstance.element.value;
// make new object based on typed characters
this.newItem = {
ContactName: this.customValue,
CustomerID: this.customValue
};
// close the popup element.
dropdownInstance.hidePopup();
// pass new object to addItem method.
dropdownInstance.addItem(this.newItem);
// select the newly added item.
dropdownInstance.value = this.customValue;
}
|
|
data: new DataManager({
url: "https://services.odata.org/V4/Northwind/Northwind.svc/Customers",
adaptor: new ODataV4Adaptor(),
crossDomain: true
}),
onFiltering: function(e) { this.query = new Query();
// frame the query based on search string with filter type.
this.query =
e.text !== ""
? this.query
.where("ContactName", "startswith", e.text, true)
: this.query;
// pass the filter data source, filter query to updateData method.
e.updateData(this.data, this.query);
},
|
data: new DataManager({
url: "https://services.odata.org/V4/Northwind/Northwind.svc/",
adaptor: new ODataV4Adaptor(),
crossDomain: true
}),
onFiltering: function(e) { this.query = new Query();
// frame the query based on search string with filter type.
this.query =
e.text !== ""
? this.query
.from("Customers")
.where("ContactName", "startswith", e.text, true)
: this.query;
// pass the filter data source, filter query to updateData method.
e.updateData(this.data, this.query);
}
|
|
|
Hi David,
Thanks for your elaboration.
We have checked the attached video. We would like to inform you that filtering process will happen if allowFiltering is set as true. We suspect that allowFiltering is not enabled and so while typing, popup is not filtered and also noRecordsTemplate not displayed. So we suggest you to set allowFiltering as true to resolve the issue. If still issue persists try to reproduce the reported issue in the attached sample that would help us to validate the issue and provide you a better solution.
Regards,Jeyanth.
onclick: function() {
// get the typed characters
var dropdownInstance = document.getElementById("country")
.ej2_instances[0];
this.customValue = dropdownInstance.element.value;
// make new object based on typed characters
this.newItem = {
Name: this.customValue,
Code: this.customValue
};
// pass new object to addItem method.
dropdownInstance.addItem(this.newItem);
//new object added to data source variable.
dropdownInstance.dataSource.push(this.newItem);
dropdownInstance.dataBind();
// close the popup element.
dropdownInstance.hidePopup();
// select the newly added item.
dropdownInstance.value = this.customValue;
document.getElementById("datasource").innerText = "";
dropdownInstance.dataSource.forEach(element => {
document.getElementById("datasource").innerText += `${element.Code}\t ${
element.Name
}\n`;
});
}
|
// add new item to database.
const formData = new FormData()
formData.append('CategoryName', customValue)
axios({
method: 'post',
url: 'https://localhost:5001/odata/Categories',
data: formData,
headers: { 'Content-Type': undefined }
})
.then((response) => {
console.warn('Axios Response: ', response)
})
onclick: function() {
// get the typed characters
var dropdownInstance = document.getElementById("country")
.ej2_instances[0];
this.customValue = dropdownInstance.element.value;
// make new object based on typed characters
this.newItem = {
Name: this.customValue,
};
// pass new object to addItem method.
dropdownInstance.addItem(this.newItem);
// select the newly added item.
dropdownInstance.value = this.customValue;
}
|
axios({
method: 'post',
url: 'https://localhost:44345/Home/UrlDatasource',
data: customData,
headers: { 'Content-Type': 'application/json'}
})
.then((response) => {
console.warn('Axios Response: ', response);
dropdownInstance.dataSource = new DataManager(response.data);
dropdownInstance.refresh();
})
|
onFocus: function(e) {
var dropdownInstance = document.getElementById("country").ej2_instances[0];
if(dropdownInstance.element.value){
dropdownInstance.searchLists(e);
}
}
|