在引导模式中使用 slickgrid [英] Use slickgrid inside a bootstrap modal
问题描述
是否可以在引导模式中使用 slickgrid?
Is it possible to user slickgrid inside a bootstrap modal?
我试过了,光滑的视口 div 高度设置为 2px 而不是正确的大小.我也在使用展开和折叠按钮,但是当我展开时,只显示当前的行数,添加了一个滚动条,但带有额外的空行而不是展开节点的子行.
I tried and the slick-viewport div height is set to 2px instead of the right size. I'm also using expand and collapse buttons, but when I expand, only the current number of rows is shown, adding a scroll but with extra empty lines instead of the child lines of the expanded node.
有人可以帮忙吗?
谢谢
推荐答案
尝试在模态加载完成后手动初始化网格.您可以使用 explicitInitialization: true
执行此操作,如 http://mleibman.github.com/SlickGrid/examples/example-explicit-initialization.html
Try manually init-ing the grid after the modal finishes loading. You can do this using explicitInitialization: true
as explained in http://mleibman.github.com/SlickGrid/examples/example-explicit-initialization.html
附言- 将此添加为答案,以便您可以根据需要接受此内容.
P.S. - adding this as an answer, so you could accept this if you wish.
由 KevinB
要补充的是,您可以绑定到模态的 shown
事件以在适当的时间执行初始化.
To add, you can bind to the modal's shown
event to perform the init with proper timing.
$("#modal").on("shown",function(){
grid.init();
});
这篇关于在引导模式中使用 slickgrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!