【发布时间】:2014-06-10 02:11:49
【问题描述】:
我在使用 KOgrid 时遇到两个问题。
1) 我无法在 kogrid 中获得滚动条。没有滚动条很难进行数据输入。
2) 如果没有指定硬编码的高度和宽度,我也无法让 kogrid 工作。在我的应用程序中,我不能有固定的高度和宽度。 其他人有同样的问题吗?
我尝试了来自该线程的解决方法建议(在我的视图模型中使用 jQuery 修复作为最后一行)。 KO Grid Display Isseues, On resize Gird shows one row. Images also included
这只是增加了网格的大小,但没有显示任何数据。但是,当我调整页面大小时,就会显示出来。
下面是我的 HTML 和 kogrid 选项(我尝试过使用和不使用分页选项,理想情况下我不想使用分页)
<div data-bind="koGrid: gridOptions"
style="height: 800px; background-color: none;width: 1850px;">
</div>
self.gridOptions = {
data: self.mydatarray,
footerVisible: true,
displaySelectionCheckbox: true,
afterSelectionChange: self.RowSelectionChange,
rowHeight: 50,
selectWithCheckboxOnly: true,
enableSorting: false,
multiSelect: true,
selectedItems: self.SelectedRows,
enableColumnResize: true,
showFilter: false,
canSelectRows: true,
enablePaging: true,
pagingOptions: {
currentPage: ko.observable(1),
pageSize: ko.observable(3),
pageSizes: ko.observableArray([3, 6, 9])
},
rowTemplate: errrowtmpl,
columnDefs: [
{ field: 'Customer', displayName: 'Customer', cellTemplate: Customersddedittmpl, headerCellTemplate: headercelltmpl },
...
...
{ field: 'GenNotes', displayName: 'GenNotes', cellTemplate: simpleedittmpl, headerCellTemplate: headercelltmpl }
]
}
如果您需要更多信息,请告诉我
谢谢
肯纳开发
【问题讨论】:
标签: height width scrollbar kogrid