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

Radio button is not displaying

2 Answers 661 Views
ButtonGroup
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 30 Sep 2014, 03:46 PM
I have issue with the radio button is not displaying. This is when the I edit the applicant and it is not populated the radio button value from the server. The issue here I think it is at the UI as I am able to see all the values in from the controller. 
<div class="radio-group">
    <div data-bind="source:applicantTypeItems" data-template="DoctoralLevelId"></div>
    <script id="DoctoralLevelId" type="text/x-kendo-template">
        <div>
            <input type="radio" name="DoctoralLevelId" data-bind="attr:{value:value},    
                  checked:DoctoralLevelId" />
            <label data-bind="text:caption"></label>
        </div>
    </script>
</div>
<script>
$(document).ready(function () {
    var applicantVm =kendo.observable($.extend({
        updated: false,
        PersonId: self.personId,
        Id: self.selectedId,
 
        DoctoralLevelId: 1,
        name: "DoctoralLevelId",
        applicantTypeItems: [
            { caption: "Pre-doc", value: 1},
            { caption: "Post-doc", value: 2 },
        ],
        // call controller and update user input
        updateApplicant : function() {
            var self = this;
            var updateData ={
                PersonId: self.personId,
                Id: self.selectedId, 
                DoctoralLevelId: self.DoctoralLevelId,
             };
 
             $.ajax({
                url: '@Url.Content("~/Applicant/UpdateNewPredoc")',
                data: JSON.stringify(updateData),
                contentType: "application/json, charset=utf-8",
                type: "POST",
                datatype: "json",
 
                error: function () {
                    toastr.error('Update failed!');
                },
                success: function (value) {
                    window.console && console.log(self);
                    window.console && console.log(value);
                    toastr.success('Update succeed!');
                },
                complete: function () {
                    window.console && console.log("completed");
                }
            });
        }
    },@(Html.ToJson(Model))));
    window.console && console.log(applicantVm);
    kendo.bind($("#applicant-info-view"), applicantVm);
})
</script>

2 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 02 Oct 2014, 07:28 AM
Hello Michael,

I am not sure what goes on in your implementation as the code below seems incomplete - I can't see the button group widget instantiation and markup. Also, it seems to work as expected when put in this dojo.  Perhaps I am missing something though; can you please update the dojo, so that we may reproduce the problem on our side? Thank you in advance. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 02 Dec 2015, 07:25 PM

This has been resolved 

Thanks

Tags
ButtonGroup
Asked by
Michael
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Michael
Top achievements
Rank 1
Share this question
or