This is a migrated thread and some comments may be shown as answers.

Grid Checkbox

6 Answers 1023 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 11 Apr 2012, 03:59 PM
I am adding the checkbox for each row on he Kendo Grid. I am also using grouping, sorting and paging options. Selecting the checkbox working fine but as soon as I either sort, group or do paging on the grid, the checkbox looses their states (all appears unchecked).

I tried using this thread http://jsfiddle.net/jkTU4/ 
But it didn't work on my local machine.

Please help.

James

6 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 10 Jul 2012, 12:11 PM
James,

I created a grid from an HTML table and have the same issue.  Did you find a solution?

Thanks,
Brian
0
Jerry T.
Top achievements
Rank 1
answered on 10 Jul 2012, 01:17 PM
Are you using a rowTemplate for the grid?  We are and was suggested by Telerik to place the template in both the rowTemplate definition and in the template property for that column in the grid's column definition.

For example,

from the grid's column definition:
{ field: "Taxable", title: "Tax?", width: 35, template: "<input type='checkbox' #= (Taxable === true) ? checked='checked' : '' # disabled />" },

and from the rowTemplate definition:
<td align="center" tabindex="109">
    <input type="checkbox" #= (Taxable === true) ? checked="checked" : "" # disabled />
</td>


Jerry
0
Asanka
Top achievements
Rank 1
answered on 31 Aug 2012, 06:15 AM
I have followed the instruction given in the thread.
Please check the following fiddle.
But it's not working. Please help.
0
OnaBai
Top achievements
Rank 2
answered on 06 Oct 2012, 01:41 AM
I've modified your fiddle and I think that now is working. Please, take a look into this.
Basically there were unbalanced ", ' and {}
0
Steve
Top achievements
Rank 1
Veteran
answered on 03 Oct 2014, 08:15 PM
I am trying to use your sample to add checkboxes to a grid and the checks are not editable.
In your demo they are also not editable. How do you make them checkable?
0
Daniel
Telerik team
answered on 08 Oct 2014, 02:18 PM
Hi,

You can make the checkboxes in the template checkable by removing the disabled attribute. To update the model based on the checkbox state, you should either use checked binding
data-columns='[{"field":"Name", "filterable":true}, {"field":"Price", "filterable":false}, "UnitsInStock", {"field":"Recon","template": "<input type=\"checkbox\" data-bind=\"checked: Recon\"" }]'
or handle the checkboxes change event. 

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Jerry T.
Top achievements
Rank 1
Asanka
Top achievements
Rank 1
OnaBai
Top achievements
Rank 2
Steve
Top achievements
Rank 1
Veteran
Daniel
Telerik team
Share this question
or