Search code examples
twitter-bootstrapslickgrid

Use slickgrid inside a bootstrap modal


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


Solution

  • 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();
    });