I am fetching a list of files from FTP and displaying it in the typedInput select tag.
So the first time I access the path of FTP I am able to fetch the files and display it in the select tag as well as in the console.
But if I try to access a different path then the list in select tag does not re render even though I am able to get the updated list in the console.
Here is my code:
$.getJSON("ftplist", function (data) {
let ftplist = data;
console.log("ftp list is ", ftplist);
if (ftplist.length > 0) {
$("#node-input-ftplist").val("");
$("#node-input-ftplist").prop("disabled", false);
for (let i = 0; i < ftplist.length; i++) {
let obj = { value: ftplist[i], label: ftplist[i] };
}
$("#node-input-ftplist").typedInput({
type: "ftplist", //is this line required?
types: [
{
value: "ftplist",
options: ftplist,
},
],
});
}
});