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

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

Kendo UI for jQuery數(shù)據(jù)管理使用教程:滾動概述

發(fā)布時間:2020/09/02 瀏覽量:3482
根據(jù)啟用的滾動模式、網(wǎng)格尺寸和布局的呈現(xiàn)方式會有所不同

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

默認(rèn)情況下,將啟用網(wǎng)格的滾動功能。根據(jù)啟用的滾動模式、網(wǎng)格尺寸和布局的呈現(xiàn)方式會有所不同。

 

 

入門指南

啟用滾動功能后,該窗口小部件默認(rèn)情況下呈現(xiàn)兩個表:一個用于標(biāo)題區(qū)域、一個用于可滾動數(shù)據(jù)區(qū)域。當(dāng)您需要手動對Grid表進(jìn)行JavaScript或CSS更新時,這兩個表很重要。

 

 
 

 

 

以下示例通過虛擬滾動展示Grid中的HTML輸出。

 

 
 

 
 

 

但是,為了較大程度的可訪問性,請禁用Grid的滾動功能。 要禁用滾動,請將scrollable選項設(shè)置為false。

$(“#grid”).kendoGrid({
scrollable: false,
// other configuration
});

 

設(shè)置滾動條

默認(rèn)情況下,啟用滾動時,網(wǎng)格不顯示滾動條。 要渲染滾動條并實現(xiàn)垂直或水平滾動,請定義網(wǎng)格的以下尺寸,您可以獨(dú)立控制垂直和水平滾動。

#GridID .k-grid-header
{
padding: 0 !important;
}

#GridID .k-grid-content
{
overflow-y: visible;
}

 

恢復(fù)滾動位置

在某些情況下,小部件反彈時,可能會重置網(wǎng)格的滾動位置。 為防止?jié)L動位置恢復(fù):

 

 

$(function () {
// Initialize the variable which will hold the scroll positions.
var scrollOffset = {
left: 0,
top: 0
};

 

// Save the scroll position before the new data is rendered.
function onGridDataBinding (e) {
var container = e.sender.wrapper.children(“.k-grid-content”); // or “.k-virtual-scrollable-wrap”
scrollOffset.left = container.scrollLeft();
scrollOffset.top = container.scrollTop(); // use only if virtual scrolling is disabled
}

 

// Restore the scroll position after the new data is rendered.
function onGridDataBound (e) {
var container = e.sender.wrapper.children(“.k-grid-content”); // or “.k-virtual-scrollable-wrap”
container.scrollLeft(scrollOffset.left);
container.scrollTop(scrollOffset.top); // use only if virtual scrolling is disabled
}

 

// Attach the Grid event handlers.
$(“#grid”).kendoGrid({
dataBinding: onGridDataBinding,
dataBound: onGridDataBound
// …the rest of the code is omitted for brevity…
});
});

 

縮放時調(diào)整滾動條和頁面布局

縮放網(wǎng)頁時,瀏覽器會更改除滾動條以外的所有頁面的內(nèi)容大小,這會導(dǎo)致啟用滾動功能的網(wǎng)格中的標(biāo)題和數(shù)據(jù)區(qū)域之間未對齊。 要調(diào)整布局,請在window.resize上執(zhí)行以下代碼。

注意:如果網(wǎng)格處于從右到左(RTL)模式,請使用“ padding-left”而不是“ padding-right”配置。

var grid = $(‘#GridID’).data(‘kendoGrid’);
grid.thead.closest(“.k-grid-header”).css(“padding-right”, kendo.support.scrollbar(true));

下一篇:遠(yuǎn)程串口:允許使用Internet或局域網(wǎng)(LAN)訪問遠(yuǎn)程串行設(shè)備
上一篇:石墨案例 | GQ的爆款文章究竟是如何誕生的?

                               

 京ICP備09015132號-996 | 違法和不良信息舉報電話:4006561155

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

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

                            華滋生物