Window display issue

4 posts, 0 answers
  1. Dayana Maliyakal
    Dayana Maliyakal avatar
    27 posts
    Member since:
    Jan 2010

    Posted 31 May 2014 Link to this post

    Hello Telerik Team,

    Window is displayed on button click.But it is not possible with a single click.Window will be displayed only after five or six times page refreshing.
    How the window will display with in a single click?

    Please check the below code:

    ​  <input type="image" src="../../Images/relateditem.gif" title="Relate Items" id="imgNonRelatedItems"
                                onclick="return testWindow();" />         

     function testWindow() {
         
            var ProjectID = document.getElementById('hfProjectID').value;
        
            var window = $("#RelateItemWindow").data("kendoWindow");        window.refresh({
                url: '/RelateItemMapping/RelateItemMapping/',
                data: { ProjectID: ProjectID }        });
        
            window.open().center();
            window.title("Add Related Items");
           
        }   

    @(Html.Kendo().Window()
    .Name("RelateItemWindow")
    //To set reload,max,close,Minimize button
    .Actions(actions =>
    actions.Close().Maximize().Minimize().Refresh()
    )
    .Title("Add Related Items")
    .Visible(false)
    .Modal(true)
    .Width(800)
    .Height(530)            
            )


    With regards
    Dayana
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 04 Jun 2014 Link to this post

    Hello Dayana,

    Please post your inquiries in the correct forum section in order to be able to receive relevant replies.

    You can debug the testWindow() function and check whether the following expression is null or not:

    $("#RelateItemWindow").data("kendoWindow")

    If it is null, then the widget is still not initialized, which can be caused by different reasons (e.g. the Window has not been loaded, or the document.ready event has not fired).

    You may also have a Javascript error on the page.

    Regards,
    Dimo
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Dayana Maliyakal
    Dayana Maliyakal avatar
    27 posts
    Member since:
    Jan 2010

    Posted 06 Jun 2014 in reply to Dimo Link to this post

    Hi Telerik Team,

    Which is the correct forum section to post inquiries ?

    I have checked testWindow() function.

     var window = $("#RelateItemWindow").data("kendoWindow");
            alert(window);

    Here initially get window object and on second time button click it will be displayed as 'undefined'.Here I am using javascript function and not jquery.How window has been loaded on second time?

     With regards
    Dayana
  4. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 06 Jun 2014 Link to this post

    Hi Dayana,

    The forum section, which is dedicated to the Window MVC wrapper is

    http://www.telerik.com/forums/aspnet-mvc/window

    As for your issue, it seems that the Window client object is being deleted at some point. This can happen if a new jQuery instance is registered on the page...

    http://docs.telerik.com/kendo-ui/getting-started/troubleshooting#javascript-error-that-kendo-widgets-are-unavailable-or-undefined

    ... or if the Window object is destroyed deliberately...

    http://docs.telerik.com/kendo-ui/getting-started/web/window/overview#destroying-a-kendo-ui-window

    ... or if the WIndow is removed from the DOM manually and the #RelatedItemWindow <div> no longer exists.

    The first thing I would check is whether the partial view, which the Window registers, is "truly partial",. i.e. it should not load any duplicate script files.

    http://docs.telerik.com/kendo-ui/getting-started/web/window/overview#loading-window-content-via-ajax

    Regards,
    Dimo
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top