KO Grid Display Isseues, On resize Gird shows one row. Images also included

僤鯓⒐⒋嵵緔 提交于 2019-12-05 15:39:49
nkstr

I'm faced with that problem as well. Strangely, it seems viewport div (the one generated by kogrid with a classname of kgViewport) is set to a fixed height of 20 px.

As a workaround, I had jQuery fix that for me (last line in my viewmodel):

$("div.kgViewport").css("height", "inherit");

The solution to the issue in your second picture is setting a height to the div. This should work:

<div style="border: 2px solid gray; height: 500px;" data-bind="koGrid: gridOptions"></div>

You should set explicit width and height on the element you bind to.

<div class="myGrid" data-bind="koGrid: gridOptions"></div>

and then in your stylesheet

.myGrid {
    width: 700px;
    height: 300px;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!