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

Using radio buttons as an edit template

2 Answers 997 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Douglas
Top achievements
Rank 1
Douglas asked on 07 Jul 2015, 05:00 PM

Please see attached.  We are trying to use a set of radio buttons for a cell editing template.  The code is below:  This works except that I have to click in the cell once to put in edit mode and then click on the radio button.  What I would like is to be able to click directly on the radio button once.  Thanks for your help.

 {
    field: "Accomplished", title: "Accomplished", width: 200,
    
    template: "<label><input ng-disabled='true' type='radio' value='#= Accomplished #' #= Accomplished == '0' ? 'checked' : ''# >&nbsp;NA&nbsp;</label>"
        + "<label><input ng-disabled='true' type='radio' value='#= Accomplished #' #= Accomplished == '1' ? 'checked' : ''# >&nbsp;Yes&nbsp;</label>"
        + "<label><input ng-disabled='true' type='radio' value='#= Accomplished #' #= Accomplished == '2' ? 'checked' : ''# >&nbsp;No&nbsp;</label>",
    
    editor: "<label><input name='Accomplished' type='radio' data-bind='checked:Accomplished' value='0'>&nbsp;NA&nbsp;</label>"
    + "<label><input name='Accomplished' type='radio' data-bind='checked:Accomplished' value='1'>&nbsp;Yes&nbsp;</label>"
    + "<label><input name='Accomplished' type='radio' data-bind='checked:Accomplished' value='2'>&nbsp;No&nbsp;</label>"
},

2 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 09 Jul 2015, 07:02 AM
Hello Douglas,

Thank you for contacting us.

To achieve the desired functionality you can try using the column’s template as in your code snippet and attach a click event to radio buttons. On the following link you can find an example which shows this approach:
http://dojo.telerik.com/@d.madjarov/InaVA/2
The example uses a checkbox as an edit control, however in your case you need just to replace the checkbox with radibuttons.

If you need further assistance, do not hesitate to contact us again.

Regards,
Radoslav
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Douglas
Top achievements
Rank 1
answered on 09 Jul 2015, 01:42 PM
Thank you very much.  Works great!
Tags
Grid
Asked by
Douglas
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Douglas
Top achievements
Rank 1
Share this question
or