Click here to Skip to main content
15,797,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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'},


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?
Updated 20-Jun-14 2:43am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900