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

[Solved] OnRefresh event getting triggerd on initialization

1 Answer 132 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonathan
Top achievements
Rank 1
Jonathan asked on 22 Nov 2011, 11:34 PM
So I'm running Telerik Q3 and MVC3. I have a window control set up in a view like so:

@(Html.Telerik().Window()
    .Name("editWindow")
    .Title("Edit Window")
    .Draggable(false)
    .ClientEvents(events =>
    {
        events.OnRefresh("onRefresh");
    })
    .Resizable(resizing => resizing.Enabled(false))
    .Buttons(b => b.Close())
    .Modal(true)
    .Width(300)
    .Height(300)
    .LoadContentFrom("LoadEditor", "File")
    .Visible(false)
)

For some reason the onRefresh js function is getting called even when the window is initially loaded, which isn't what I want to happen. According to the documentation, the OnRefresh event should only be triggered after a refresh or ajaxRequest, neither of which get called when the view is first loaded.

This is a problem because in my js onRefresh function, the window gets opened. I don't want the window to open when the page first loads, hence why visible is set to false initially. Am I misunderstanding something? I thought only OnLoad gets triggered when the window is initialized.

1 Answer, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 23 Nov 2011, 07:22 PM
ignore this post. (but not the first post!)
Tags
Window
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Share this question
or