Hello Webix Team,
i have a problem with re-using the suggest list.
I have two pages and a similar combo (with dynamic suggest list) element on both of them. In the first page the user selects the Postal code and the values inside are dynamically loaded. After the user completes the form entry and enters all other data, the page is redirected to the second. On the second page, i want to display the same value as the user selected on the first page but still want to keep the option for user to change the value before completing the final form.
First page suggest define (needs to be dynamically loaded for user selected country):
$$("comboLoadPost").define("suggest", {
css:{"word-break": "break-all"},
keyPressTimeout: 500,
body:{
view:"list",
dynamic:true,
datafetch:10,
loadahead:50,
datathrottle: 100,
url:"data/LoadPostalCodes.php?country="+selectedCountry,
dataFeed:"data/LoadPostalCodes.php?country="+selectedCountry,
template:"#Code# #Name#",
yCount:10,
},
});
Second page define:
$$("comboLoadPostDetails").define("suggest", {
css:{"word-break": "break-all"},
keyPressTimeout: 500,
body:{
id:"comboLoadPostDetailsList"
view:"list",
dynamic:true,
datafetch:10,
loadahead:50,
datathrottle: 100,
url:"data/LoadPostalCodes.php?country="+selectedCountry,
dataFeed:"data/LoadPostalCodes.php?country="+selectedCountry,
template:"#Code# #Name#",
yCount:10,
},
});
Second page previous value set :
$$("comboLoadPostDetailsList").loadNext(10, parseInt(firstPageSelectedID)).then(res=>{
$$("comboLoadPostDetails").setValue(firstPageSelectedValue);
})
Everything works fine, until i select any value outside my loadahed (in my case any value 50 +). The data and id are stored but on the second page, they are not loaded and displayed. I understand the value is not set because data inside suggest is not already loaded.
My question is: Is there any way, i can link same suggest list to different combo boxes or just reloaded the previous page loaded data to this pages combo? Or is there any other way i can solve this?
Thank you very much in advance.