Jack
Jack

Reputation: 1

Cannot show loading spinner on Kendo window

I want to show a loading spinner on Kendo window by its default loading spinner. Could you please inform me about the mistake in my code? Thanks.

View:

@(Html.Kendo().Window()
    .Name("winCreate")
    .Visible(false)
    .LoadContentFrom("Create", "Issue")        
    .Modal(true)
    .Actions(actions => actions
        .Close()
     )
)


<script type='text/javascript'>
function createWindow() {
    var window = $("#winCreate").data("kendoWindow");
    window.refresh({
        url: "/Issue/Create"
    });
    window.center();
    window.open();
};
</script>

Here are some configurations I have tried, but I cannot make them to work properly. Could you have a look at them please?

http://docs.kendoui.com/api/web/window#events-open

http://docs.kendoui.com/api/web/window#events-refresh

http://docs.kendoui.com/api/web/ui#methods-progress

Here is another sample that I cannot integrate to my javascript method:

"You can use the Window's open and refresh events to show and hide the native Kendo UI loading indicator over the Window's content container. This container is the element, from which the widget is created."

function onOpen(e) {
    kendo.ui.progress(e.sender.element, true);
}

function onRefresh(e) {
    kendo.ui.progress(e.sender.element, false);
} 

Upvotes: 1

Views: 3107

Answers (1)

JFlox
JFlox

Reputation: 708

If you want to use events like "open" then add .Events like in the snippet below.

@(Html.Kendo().Window()
  .Name("winCreate")
  .Visible(false)
  .LoadContentFrom("Create", "Issue")        
  .Modal(true)
  .Actions(actions => actions
      .Close()
   )
  .Events(events => events
            .Open("onOpen")
            .Refresh("onRefresh")
        )
 )

That should get your functions to fire.

see http://demos.telerik.com/aspnet-mvc/window/events

Upvotes: 1

Related Questions