Disable/Enable the checkbox in kendo grid based on column Value

℡╲_俬逩灬. 提交于 2019-12-02 12:23:36

Seems that what you need is controlling if the input field of type="checkbox" is disabled. So you should defined the template as follow:

<script id="template" type="text/kendo-template">
   #if(ResultFormatID != 3) { #   
   <input type="checkbox" #= data.Action ? checked="checked" : "" #  class=\"check_row\" #= data.Status == 'Certified' ? disabled='disabled' : "" #/>
   # } else { #
<input type="button" class="k-button info" name="info" value="Preview" />
   # } #
</script>

I.e: add the condition of data.Status == 'Certified' ? disabled='disabled' : ""

See it in action here: http://jsfiddle.net/Hfk3Q/

EDIT: Changes required when clicking on headers check box would be changing its implementation for checking only those cells that are not disabled. Something like:

$('.check_row:not(:disabled)', grid.tbody).prop('checked', true);

See it in action here: http://jsfiddle.net/Hfk3Q/3/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!