7
Answers

How to delete unchecked value

Good Evening,
 
i am trying to delete the notification number from "this.ary" when the respective checkbox is unchecked in the grid view in the else condition which is not happening in the following typescript....so,please do the needful!!
  1. for (let i = 0; i < eleData.length; i++) {  
  2. var str = this.ary;  
  3. var notVal = str.includes(Notification_No);  
  4. if (eleData[i].checked && notVal==false) {  
  5. checkBoxSelectedItems1.push(Notification_No);  
  6. this.ary +=Notification_No+","  
  7. }  
  8. else if (!eleData[i].checked && notVal==true)  
  9. {  
  10. checkBoxSelectedItems1.pop();  
  11. // this.ary=str.slice();  
  12. }  
  13. }  
Answers (7)