Getting:" Unable to get property 'open' of undefined or null reference" in telerik window open

1 posts, 0 answers
  1. sushil
    sushil avatar
    1 posts
    Member since:
    Sep 2015

    Posted 21 Mar Link to this post

    Below is my code

    @{Html.Telerik().Window()
        .Name("SupportDetailCommentPopup")
        .Title("Comment")
        .Content(@<text>
            <form>
                <div class="popup-validation-summary" style="display: none;">
                    <ul class="popup-validation-message-list"></ul>
                </div>
                <textarea id="SupportDetailCommentText" maxlength="255" style="width: 280px; height:100px" class="t-input ignoreForUnsavedChanges"></textarea>
                <ul class="editor-fields">
                    <li>
                        @Html.Label("Updated By")
                        <div id="SupportDetailCommentLastUpdatedByText"></div>
                    </li>
                    <li>
                        @Html.Label("Last Updated Date")
                        <div id="SupportDetailCommentLastUpdatedDateText"></div>
                    </li>
                </ul>

                <input type="button" value="Save" id="FundsAvailableForMonthPopUpSave" onclick="" class="t-button button-spacing" />
                <input type="button" value="Cancel" onclick="" class="t-button button-spacing" />
            </form>
        </text>)
        .Modal(true)
        .Visible(false)
        .Draggable(true)
        .ClientEvents(e => e.OnOpen("SupportDetailCommentPopUpOpen"))
        .Width(300);
    }

      $(document).on("click", ".comment-style", function (e) {
                e.preventDefault();
                PopulateSupportDetailCommentPopUp(e);
                $("#SupportDetailCommentPopup").data('tWindow').open();//getting Exception on this line
            }); 

            function PopulateSupportDetailCommentPopUp(e)
            {
                var vm={CommentText:"test",LastUpdated:"SRJ",LastUpdatedDate:"March 21, 2016"};
                
                $("#SupportDetailCommentPopup").data('viewModel', vm);
                $('#SupportDetailCommentText').val(vm.CommentText);
                $("#SupportDetailCommentLastUpdatedByText").text(vm.LastUpdatedBy);
                $("#SupportDetailCommentLastUpdatedDateText").text(vm.LastUpdatedDate);
        
            }
Back to Top