You need to sign in to do that
Don't have an account?
VJ_SFDC
Lightining reredner issue
Rerender issue in lighting component after deleting iterator is not changing.
Display checkbox for the iterator and deleting the record successfully from controller after that querying data back again and trying to refresh iterator, How do i refresh iterator list after deleting data from apex controller.
This is the line using to reset records after deleting.
component.set('v.relatedContactsRoles', response.getReturnValue());
Display checkbox for the iterator and deleting the record successfully from controller after that querying data back again and trying to refresh iterator, How do i refresh iterator list after deleting data from apex controller.
deleteSelectedHelper: function(component, event, deleteRecordsIds) { alert('deleteRecordsIds==='+deleteRecordsIds); var action = component.get('c.deleteRecords'); action.setParams({ "lstRecordId": deleteRecordsIds,"AccountId" : component.get("v.AccountId") }); action.setCallback(this, function(response) { //store state of response var state = response.getState(); if (state === "SUCCESS") { console.log(state); //alert(response.getReturnValue()); //component.set('v.relatedContactsRoles', response.getReturnValue()); if (response.getReturnValue() != '') { //alert('inside of response '); alert(response.getReturnValue()); component.set('v.relatedContactsRoles', ''); component.set('v.relatedContactsRoles', response.getReturnValue()); // alert(state); // alert('The following error has occurred. while Delete record-->' + response.getReturnValue()); }else { console.log('check it--> delete successful'); } //this.testonLoad(component, event); } }); $A.enqueueAction(action); },
This is the line using to reset records after deleting.
component.set('v.relatedContactsRoles', response.getReturnValue());
what value you have in response.getReturnValue() and try to set the list with empty array
var emptyArr = [];
component.set('v.relatedContactsRoles', emptyArr );
thanks
Hi Piyush,
Thank you for your response and changed the code as per your comment and still no luck also posting controller method. Do you see any issues? I hope you understand my earlier explanation that the record is deleted successfully from controller method and again I am querying data, is there any chance can i delete the record from the list without passing data to the controller so that everything will happen server-side and I believe it should work.
Actually, after deleting, I have verified that the deleted records are not there in the response.getReturnValue() meaning before delete suppose there are 10 records and i selected 2 records after that when i check with alert I could see that list is retunring 8 records only. the problem is iterator part is not refreshing.
suppose for the div if I use aura: id="something" how do I refresh from JS so that it will work may be.