Thank you for sharing knowledge related to this check box selection and how to handle its states. This article helps me to find a solution for my issue.
But there is an issue with the logic you have mentioned here. That is when I select multiple rows without selecting all rows and try to be unchecked all rows by clicking header check box (master checkbox); at that time header check box (master checkbox) displayed as checked (display as selected).
This is because when we select rows the value of master_checked is false (That is unchecked state) and when we click header check box (master checkbox), the value of master_checked is set to true. Because of that at that time master checkbox shows as checked.
I could fix this issue by setting master_checked = true when only multiple rows but not all are selected.
if(checked_count>0 && checked_count<this.checkbox_list.length){
     // If some checkboxes are checked but not all; then set Indeterminate state of the master to true.
     this.master_indeterminate = true;
     this.<strong>master_checked </strong>=<strong> </strong>true
}

Reply