cobolstinks
cobolstinks

Reputation: 7153

how to nest a kendo-window in kendo-treeview?

I'm trying to nest a window in a treeview. I want it so that when a user selects a particular node it will open a kendo window. Has anyone done this? I'm not seeing much on the demos that demonstrate something similar.

I'm using the mvc wrappers. Thanks!

Upvotes: 0

Views: 327

Answers (1)

HaBo
HaBo

Reputation: 14297

Onclick event of your tree node

call this

$("tree node").click(function(){
 KendoDialog("Window TItle", "Content in the window", 700, 350);
});

function KendoDialog(windowTitle, message, windowWidth, windowHeight) {
    var WindowElement = $("#kwDialog").data("kendoWindow");
    WindowElement.setOptions({
        width: windowWidth,
        height: windowHeight,
        title: windowTitle
    });
    WindowElement.content("<b>" + message + "</b>");
    WindowElement.center().open();
}

put this some where in your layout

@(Html.Kendo().Window()
            .Name("kwDialog")
            .Title("Alert!")
            .Modal(true)
            .Visible(false)
           )

Upvotes: 1

Related Questions