[英]DataTable and Kendo Window UI
我正在嘗試學習和實現DataTable到我的項目。 實際上,我確實需要DataTable導出功能。
我的頁面上有一個按鈕。 它打開的Kendo UI窗口,一切都還不錯。 但是,當我單擊新窗口頁面上的“導出excel,導出pdf,...”按鈕時,導出按鈕對我不起作用。
我想我的腳本崩潰了。 我已經嘗試了幾個小時,但我做不到。 您的所有幫助將不勝感激。
//這是我的劍道窗口代碼:
@(Html.Kendo().Window()
.Name("myWindow") //The name of the window is mandatory. It specifies the "id" attribute of the widget.
.Title("Login") //set the title of the window
.Content(@<text>
<table id="example" class="display" cellspacing="0">
// my table content
</table>
<script>
$(document).ready(function () {
$('#example').dataTable({
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "/Scripts/datatables/copy_csv_xls_pdf.swf"
}
});
});
</script>
</text>)
.Draggable() //Enable dragging of the window
.Resizable() //Enable resizing of the window
.Modal(true)
.Visible(false)
)
// Kendo的腳本
<script>
function openWindow() {
var wdw = $("#myWindow").data("kendoWindow"); //get the Window widget's instance
wdw.center();
wdw.open(); //and call its open method
}
</script>
//我的按鈕觸發“ openWindow();
<input onclick="openWindow()" value=" Özet Tabloyu Göster " />
// DataTable導出腳本
<script>
$(document).ready(function () {
$('#example').dataTable({
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "/Scripts/datatables/copy_csv_xls_pdf.swf"
}
});
});
</script>
您可以直接將表標記的內容導出到excel文件中,而不必使用DataTable。 請參考此鏈接答案
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.