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

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

0 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sushil
Top achievements
Rank 1
sushil asked on 21 Mar 2016, 03:09 PM

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);
    
        }

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
sushil
Top achievements
Rank 1
Share this question
or