如何填充KendUI窗口 [英] how to populate a KendUI Window
问题描述
我是Kendo UI的新手.我希望能够显示带有控制器结果的弹出窗口.
I am new to Kendo UI. I would like to be able to display a popup with the results from my controller.
我的例子很简单.我的页面上有这些数据.
My example is very simple. I have this data on my page.
Some text [Create]
当我单击[创建]时,对控制器进行了呼叫.控制器将创建一个PDF文件.接下来,我希望能够在KendoUI窗口中显示pdf.
When I click on [Create], a call in made to my controller. The controller will create a PDF file. Next, I would like to be able to display the pdf in a KendoUI Window.
我很想知道如何将信息传递回页面,因此KendoUi Window知道要显示的PDF文件名.
I am getting hung up on how to pass info back to page so the KendoUi Window is aware of the PDF file name to display.
提前感谢您的提示.
史蒂夫
MVC 4
KendoUI 2012.2.270
KendoUI 2012.2.270
推荐答案
有两种基本方法:
- 您可以在加载页面时创建窗口,并具有更改内容并使之可见的功能.
- 您每次都创建一个窗口.
假设您为1.那么您有一个类似这样的HTML
Assuming that you for 1. Then you have an HTML that is something like this
<div id="popup_window">
</div>
<a href="#" id="show">Create PDF</a>
然后定义窗口和click
绑定,用于触发打开方式为:
Then you define the window and the click
bind for triggering the open as:
$("#popup_window").kendoWindow({
title :"PDF document",
visible :false
});
$("#show").click(function () {
$("#popup_window").html("<object id='pdf' data='doc.pdf' type='application/pdf'/>");
$("#popup_window").data("kendoWindow").open();
});
在其中创建kendoWindow
的位置,但是将其可见性设置为不可见.
然后,我将一个函数绑定到单击Create PDF
消息上的单击上,该消息将内容设置为HTML object
,其中data
属性是pdf文档,然后通过调用kendoWindow
open
方法打开.
Where I create a kendoWindow
but set it's visibility to not visible.
Then I bind a function to the click on the Create PDF
message that sets the content to an HTML object
where data
attribute is the pdf document and then open by invoking kendoWindow
open
method.
这篇关于如何填充KendUI窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!