国产精品久久久久久2021,日韩精品无码av中文无码版,亚洲精品久久久午夜麻豆,无码成人精品日本动漫纯h

010-68421378
當(dāng)前您所在的位置:首頁>新聞中心>新品發(fā)布

Kendo UI for jQuery數(shù)據(jù)管理使用教程:打印

發(fā)布時(shí)間:2020/08/28 瀏覽量:3412
Kendo UI for jQuery是創(chuàng)建現(xiàn)代Web應(yīng)用程序的完整UI庫。

 

Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個(gè)控件。Kendo UI for jQuery是創(chuàng)建現(xiàn)代Web應(yīng)用程序的完整UI庫。

 

打印

即使Grid的內(nèi)容可能不是頁面上的唯一內(nèi)容,Grid也提供忽略頁面其余部分并僅打印其內(nèi)容的選項(xiàng)。

要僅從頁面上打印Grid,請(qǐng)使用以下兩種方法:

打印現(xiàn)有頁面,并使用打印CSS隱藏不相關(guān)的內(nèi)容。

打印僅帶有Grid的單獨(dú)網(wǎng)頁。

 

打印現(xiàn)有網(wǎng)頁

若要僅將Grid作為現(xiàn)有網(wǎng)頁的一部分進(jìn)行打印,請(qǐng)使用打印樣式表隱藏頁面中不需要的部分,確切的CSS打印取決于現(xiàn)有頁面內(nèi)容。

 

打印新網(wǎng)頁

下面的示例演示如何檢索Grid的HTML,如何將其注入到新的瀏覽器窗口中以及打印新頁面。此方法還解決了以下重要問題:

 

 

 

 

function printGrid() {
var gridElement = $(‘#grid’),
printableContent = ”,
win = window.open(”, ”, ‘width=800, height=500, resizable=1, scrollbars=1’),
doc = win.document.open();

var htmlStart =
‘’ +

’ +
’ +
’ +

’ +

 ‘ +
’ +
’ +

var htmlEnd =
‘’ +
‘’;

var gridHeader = gridElement.children(‘.k-grid-header’);
if (gridHeader[0]) {
var thead = gridHeader.find(‘thead’).clone().addClass(‘k-grid-header’);
printableContent = gridElement
.clone()
.children(‘.k-grid-header’).remove()
.end()
.children(‘.k-grid-content’)
.find(‘table’)
.first()
.children(‘tbody’).before(thead)
.end()
.end()
.end()
.end()[0].outerHTML;
} else {
printableContent = gridElement.clone()[0].outerHTML;
}

doc.write(htmlStart + printableContent +htmlEnd);
doc.close();
win.print();
}

$(function () {
var grid = $(‘#grid’).kendoGrid({
dataSource: {
type: ‘odata’,
transport: {
read: “https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products”
},
pageSize: 20,
serverPaging: true,
serverSorting: true,
serverFiltering: true
},
toolbar: kendo.template($(‘#toolbar-template’).html()),
height: 400,
pageable: true,
columns: [
{ field: ‘ProductID’, title: ‘Product ID’, width: 100 },
{ field: ‘ProductName’, title: ‘Product Name’ },
{ field: ‘UnitPrice’, title: ‘Unit Price’, width: 100 },
{ field: ‘QuantityPerUnit’, title: ‘Quantity Per Unit’ }
]
});

$(‘#printGrid’).click(function () {
printGrid();
});

});

下一篇:SonarQube:用于持續(xù)檢查代碼庫的代碼質(zhì)量和安全性
上一篇:Retrospect:提供系統(tǒng)恢復(fù)、本地備份以及集中管理、端到端安全等

                               

 京ICP備09015132號(hào)-996 | 違法和不良信息舉報(bào)電話:4006561155

                                   © Copyright 2000-2026 北京哲想軟件有限公司版權(quán)所有 | 地址:北京市海淀區(qū)西三環(huán)北路50號(hào)豪柏大廈C2座11層1105室

                         北京哲想軟件集團(tuán)旗下網(wǎng)站:哲想軟件 | 哲想動(dòng)畫

                            華滋生物