SyncFusion ejTreeGrid - 删除滚动条
SyncFusion ejTreeGrid - remove scrollbar
我应该怎么做?它似乎使用 ejScroller 因为我使用 <ej-scroller>
html 的地方是相同的,具有这样的元素:
<div class="e-scrollbar e-js e-widget e-vscrollbar" style="height: 622px; width: 18px;">
Syncfusion TreeGrid 具有“自动”高度支持,用户可以使用它在没有垂直滚动条的情况下显示 TreeGrid 中的所有记录。在这种情况下,如果 TreeGrid 高度超过浏览器视口,浏览器滚动条将出现,这可以通过将 sizeSettings.height 属性 设置为 auto 来实现。请参考以下代码片段。
<ej-treegrid id="TreeGridContainer" [dataSource]="treeGridData"
sizeSettings.height="auto"
//…
</ej-treegrid>
我们还可以通过使用 create, collapsed, expanded, actionComplete 客户端事件和一些解决方法来显示没有滚动条和固定高度的 TreeGrid。请参考以下代码片段。
[HTML]
<ej-treegrid id="TreeGridContainer" [dataSource]="treeGridData"
(create)="create($event)" (collapsed)="collapsed($event)" (expanded)="expanded($event)" (rowSelected)="rowSelected($event)" (actionComplete)="actionComplete($event)"
//..
</ej-treegrid>
[TS]
create(args) {
/To update the height of TreeGrid during load time
this.updateTreeHeight();
}
collapsed(args) {
//To update the height of TreeGrid during collapse action
this.updateTreeHeight();
}
expanded(args) {
//To update the height of TreeGrid during expand action
this.updateTreeHeight();
}
rowSelected(args) {
//To update the height of TreeGrid while adding any row
this.updateTreeHeight();
}
actionComplete(args) {
//To update the height of TreeGrid while saving the newly added row and deleting the existing row
if (args.requestType == "addNewRow" || args.requestType == "delete") {
this.updateTreeHeight();
}
}
updateTreeHeight=function() {
var tree = $("#TreeGridContainer").ejTreeGrid("instance"),
toolbar = $("#TreeGridContainer_toolbarItems").height(),
model = tree.model,
totalLen = tree.getExpandedRecords(model.updatedRecords);
if (toolbar == undefined)
toolbar = 0;
//To calculate the height of TreeGrid as per records count
var height = model.rowHeight * totalLen.length + tree.getHeaderContent().height() + toolbar + 4;
//Update height using setModel
var sizesettings = { height: height.toString() };
tree.setModel({ "sizeSettings": sizesettings });
}
请在下面找到示例 link
http://www.syncfusion.com/downloads/support/directtrac/general/ze/TreeGrid_without_scrollbar-1219686615
此致,
彭尼亚穆尔提
我应该怎么做?它似乎使用 ejScroller 因为我使用 <ej-scroller>
html 的地方是相同的,具有这样的元素:
<div class="e-scrollbar e-js e-widget e-vscrollbar" style="height: 622px; width: 18px;">
Syncfusion TreeGrid 具有“自动”高度支持,用户可以使用它在没有垂直滚动条的情况下显示 TreeGrid 中的所有记录。在这种情况下,如果 TreeGrid 高度超过浏览器视口,浏览器滚动条将出现,这可以通过将 sizeSettings.height 属性 设置为 auto 来实现。请参考以下代码片段。
<ej-treegrid id="TreeGridContainer" [dataSource]="treeGridData"
sizeSettings.height="auto"
//…
</ej-treegrid>
我们还可以通过使用 create, collapsed, expanded, actionComplete 客户端事件和一些解决方法来显示没有滚动条和固定高度的 TreeGrid。请参考以下代码片段。
[HTML]
<ej-treegrid id="TreeGridContainer" [dataSource]="treeGridData"
(create)="create($event)" (collapsed)="collapsed($event)" (expanded)="expanded($event)" (rowSelected)="rowSelected($event)" (actionComplete)="actionComplete($event)"
//..
</ej-treegrid>
[TS]
create(args) {
/To update the height of TreeGrid during load time
this.updateTreeHeight();
}
collapsed(args) {
//To update the height of TreeGrid during collapse action
this.updateTreeHeight();
}
expanded(args) {
//To update the height of TreeGrid during expand action
this.updateTreeHeight();
}
rowSelected(args) {
//To update the height of TreeGrid while adding any row
this.updateTreeHeight();
}
actionComplete(args) {
//To update the height of TreeGrid while saving the newly added row and deleting the existing row
if (args.requestType == "addNewRow" || args.requestType == "delete") {
this.updateTreeHeight();
}
}
updateTreeHeight=function() {
var tree = $("#TreeGridContainer").ejTreeGrid("instance"),
toolbar = $("#TreeGridContainer_toolbarItems").height(),
model = tree.model,
totalLen = tree.getExpandedRecords(model.updatedRecords);
if (toolbar == undefined)
toolbar = 0;
//To calculate the height of TreeGrid as per records count
var height = model.rowHeight * totalLen.length + tree.getHeaderContent().height() + toolbar + 4;
//Update height using setModel
var sizesettings = { height: height.toString() };
tree.setModel({ "sizeSettings": sizesettings });
}
请在下面找到示例 link http://www.syncfusion.com/downloads/support/directtrac/general/ze/TreeGrid_without_scrollbar-1219686615
此致,
彭尼亚穆尔提