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

Window display issue

3 Answers 36 Views
AJAX and Web 2.0
This is a migrated thread and some comments may be shown as answers.
Dayana Maliyakal
Top achievements
Rank 1
Dayana Maliyakal asked on 31 May 2014, 05:41 AM
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

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 Jun 2014, 12:45 PM
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.

 
0
Dayana Maliyakal
Top achievements
Rank 1
answered on 06 Jun 2014, 09:41 AM
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
0
Dimo
Telerik team
answered on 06 Jun 2014, 10:54 AM
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.

 
Tags
AJAX and Web 2.0
Asked by
Dayana Maliyakal
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Dayana Maliyakal
Top achievements
Rank 1
Share this question
or