Uncaught TypeError: Cannot read property 'checked' of undefined

1 posts, 0 answers
  1. Kevin
    Kevin avatar
    5 posts
    Member since:
    May 2012

    Posted 09 Nov 2012 Link to this post

    Hi,


    I am using the popover with listview and checkbox or radio items. With radio everything works finde, but when I am using checkboxes I get the Error: Uncaught TypeError: Cannot read property 'checked' of undefined
    Any idea, what could be wrong? I am creating the Items like this:

    $this.children().each(function (i) {
        var $item = $("<li><label>" + $(this).val() + " <input type=\"" + (base.multiple ? "checkbox" : "radio") + "\" " + (this.selected ? "checked=\"checked\"" : "") + " /></label></li>");
        listview.prepend($item);
        var that = this;
        $item.on("click", function () {
            console.log("test");
            that.selected = true;
            $this.ButtonCombobox("setSelection");
        })
    });
    The error is thrown before output "test" and is thrown by kendo.mobile.min.js.
Back to Top