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

Edit boolean field as checkbox

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 1
Mario asked on 08 Jan 2015, 01:39 PM
Hi

Reading following forum post (http://www.telerik.com/forums/display-boolean-field-as-checkbox) has lead me to try it.

What does not work is when I click the checkbox it does not get checked / unchecked. jsfiddle here: http://jsfiddle.net/3n2ottx7/

Funny enough - I can click the cell (anywhere but the actual checkbox), then click the checkbox inside that cell (only).

How can it work as expected and why is this not a standard example? - No normal user in the world works with "true" / "false" that turn into checkboxes when clicked - as per kendo example: http://dojo.telerik.com/ANItE

Thanks

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 12 Jan 2015, 02:39 PM
Hi Mario,

The behavior that you are describing is due to browsers limitation for firing event from disabled elements. The problem with the disabled checkbox and that limitation is that once you click on that element, no event will fire and the grid will fail to open the cell for editing. You can test this limitation with the following simple example:
<script type="text/javascript">
    function checkboxClicked() {
        alert("clicked");
    }
</script>
 
<input type="checkbox" checked="checked" disabled="disabled" onclick="checkboxClicked()" />

If you want to have a checkbox in the cell (in normal mode), the only possible way for opening that cell for editing will be to click outside the disabled element.

Hope this helps.


Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Mario
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or