Radio button is not displaying

3 posts, 0 answers
  1. Michael
    Michael avatar
    7 posts
    Member since:
    Apr 2014

    Posted 30 Sep 2014 Link to this post

    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. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 02 Oct 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Michael
    Michael avatar
    7 posts
    Member since:
    Apr 2014

    Posted 02 Dec 2015 in reply to Petyo Link to this post

    This has been resolved 

    Thanks

Back to Top