Posted 29 January 2021, 10:07 am EST
Hello,
How can the newly added or updated data in wijmo listbox be autosaved, like without clicking on save button.
Thank you.
Regards,
Nivisha
Forums Home / Wijmo / General Discussion
Posted by: nivishapanwar on 29 January 2021, 10:07 am EST
Posted 29 January 2021, 10:07 am EST
Hello,
How can the newly added or updated data in wijmo listbox be autosaved, like without clicking on save button.
Thank you.
Regards,
Nivisha
Posted 1 February 2021, 3:13 am EST
Hi Nivisha,
Can you please explain your requirements in detail? Are you trying to save the added or updated data in Listbox to the database?
Regards,
Ashwin
Posted 1 February 2021, 3:36 am EST
Hi Ashwin,
I am adding new data as well as updating and deleting the existing data in listbox.
addRecord() {
this.recordData.push(this.fullname);
this.name = new CollectionView(this.recordData);
//localStorage.setItem(“names”, JSON.stringify(this.recordData));
console.log(this.recordData);
}
updateRecord() {
//let lb = this.name1;
let textBoxValue = this.fullname || “”;
if (textBoxValue) {
let cv = this.ListData.collectionView;
cv.items[this.ListData.selectedIndex] = textBoxValue;
cv.refresh();
}
}
removeRecord() {
let lb = this.ListData.collectionView;
lb.items.splice(this.ListData.selectedIndex, 1);
lb.refresh();
this.fullname = “”;
}
displayListBoxValueInTextField(listBox) {
this.fullname = listBox.selectedValue;
this.isOkDisabled = false;
this.isDisabled = true;
}
Thank you.
Regards,
Nivisha
Posted 2 February 2021, 2:21 am EST
As per my understanding, you must be calling these methods on a button click. Now, your requirement is to call these methods automatically. But, there must be an event where you wish to call these. For example, if a user presses the delete key, then the selected item should be deleted, or if a user presses Enter key after entering a new value.
Please explain exactly what your requirements are so that I can provide you a solution.
~regards
Posted 2 February 2021, 2:37 am EST
Hi Ashwin,
Yes for add, update and delete i am using button functionality but for save i am not using any button.
saveListBoxData() {
this.ListSer.SaveListBoxDataFromWebApi(this.deliveryMethodKey, this.destinationKey, this.isChecked,this.isName).subscribe(data => { //this.save= data["SaveWorkFlowConfigurationsResult"] console.log(data); });
}
Thank you.
Regards,
Nivisha
Posted 3 February 2021, 2:04 am EST
Hi Nivisha,
Please refer to the sample link below:
https://stackblitz.com/edit/js-kodfbs
This sample demonstrates how to save data automatically after adding or deleting.
Let me know if this helps.
~regards
Posted 3 February 2021, 4:25 am EST
Hi Ashwin,
Thank you , I have now directly used my save method with the service endpoint.
Regards,
Nivisha