Use slickgrid inside a bootstrap modal

放肆的年华 提交于 2020-01-02 13:36:51

问题


Is it possible to user slickgrid inside a bootstrap modal?

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.

Can anyone help?

Thanks


回答1:


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.


Edit by KevinB:

To add, you can bind to the modal's shown event to perform the init with proper timing.

$("#modal").on("shown",function(){
    grid.init();
});


来源:https://stackoverflow.com/questions/11652774/use-slickgrid-inside-a-bootstrap-modal

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