Database DesignPHPHHTMLDatabaseMySQL
รีวิวสล็อตออนไลน์ เกมสล็อตออนไลน์ เว็บสล็อตUFABET
I have done auto complete, but I want to make a quote with a push button to add more lines. Then when you press search on the list It always goes up to the first line. I want it to be saved that we chose the first line. The second line goes on and on. Please help me
|
filtering: (e: FilteringEventArgs) => {
let query: Query = new Query();
// frame the query based on search string with filter type.
query = (e.text !== '') ? query.where('Name', 'startswith', e.text, true) : query;
// pass the filter data source, filter query to updateData method.
e.updateData((data as any).countries, query);
if (document.getElementById('nodata')) {
// bind click event to button which is shown in popup element when the typed character(s) is not present in the list
document.getElementById('btn').onclick = () => {
// get the typed characters
let customValue: string = (document.getElementById('country') as HTMLInputElement).value;
// make new object based on typed characters
let newItem: { [key: string]: Object; } = {'Name': customValue, 'Code': customValue };
// new object added to data source.
(autoCompleteObj.dataSource as Object[]).push(newItem);
// close the popup element.
autoCompleteObj.hidePopup();
// pass new object to addItem method.
autoCompleteObj.addItem(newItem,1);
// select the newly added item.
autoCompleteObj.value = customValue;
};
}
}
|
|
filtering: (e: FilteringEventArgs) => {
let query: Query = new Query();
// frame the query based on search string with filter type.
query =
e.text !== '' ? query.where('Name', 'startswith', e.text, true) : query;
// pass the filter data source, filter query to updateData method.
e.updateData((data as any).countries, query);
if (document.getElementById('nodata')) {
// bind click event to button which is shown in popup element when the typed character(s) is not present in the list
document.getElementById('btn').onclick = () => {
// get the typed characters
let customValue: string = (document.getElementById(
'country'
) as HTMLInputElement).value;
// make new object based on typed characters
let newItem: { [key: string]: Object } = {
Name: customValue,
Code: customValue
};
// new object added to data source.
(autoCompleteObj.dataSource as Object[]).splice(0, 0, newItem);
// close the popup element.
autoCompleteObj.hidePopup();
// pass new object to addItem method.
autoCompleteObj.addItem(newItem, 0);
// select the newly added item.
autoCompleteObj.value = customValue;
};
} |