I am using kogrid where i thought of using the default checkbox and check/uncheck it based on a value from the list that is being bound to it. And also when i check/uncheck this checkbox, it should update the selectedItems property appropriately. I checked cellTemplate. But I am unable to identify how to use it.
<pre lang="HTML">
<div style="height: 650px; width: 99%;" data-bind="koGrid: { data: allList,displaySelectionCheckbox: true, multiSelect :true, selectWithCheckboxOnly: true, selectedItems: selectedList ,
footerVisible : false, disableTextSelection: false,
afterSelectionChange: function (rowItem) { return true; },
columnDefs: [{ field: 'Name', displayName: 'Name', width: '20%' ,headerTemplate: 'koHeader' },
{ field: 'Country', displayName: 'Country', width: '20%' ,headerTemplate: 'koHeader' },
{ field: 'DOB', displayName: 'DOB', width: '20%' ,headerTemplate: 'koHeader' },
{ field: 'Profession', displayName: 'Profession', width: '20%' ,headerTemplate: 'koHeader' },
{field: 'IsToBeChecked', displayName: 'Selection', width: '30%', headerClass: 'koHeader'},
]
}">
</div>
From the above html code, IsToBeChecked is the column based on which the 'displaySelectionCheckbox' should be checked or unchecked.
Could some one suggest me how check/uncheck the default checkbox based on a value?