KoGrid icon indicating copy to clipboard operation
KoGrid copied to clipboard

Grid fails to size or resize properly if initially rendered hidden

Open ImaginaryDevelopment opened this issue 12 years ago • 4 comments

fix on my side was to call the grid's init() method after it was made visible.

 self.isInboxVisible.subscribe(function (newValue) {
        if (newValue === true && !initializedgrid) {
            initializedgrid = true;
            ko.contextFor($('.koGrid').first().children()[0]).$data.init();
        }

    });

ImaginaryDevelopment avatar Apr 18 '13 13:04 ImaginaryDevelopment

I'm having the same problem. I'm using durandal for composition and my koGrid is nested within another view. The visible binding lives on the outer view (not on the grid's view). Where did you place the above code? In the grid's viewmodel? What is "isInboxVisible"?

KimberleyMeyer avatar May 01 '13 15:05 KimberleyMeyer

I put it in my main ko model

ImaginaryDevelopment avatar May 01 '13 16:05 ImaginaryDevelopment

Using this line doesn't seem to work for me: ko.contextFor($('.koGrid').first().children()[0]).$data.init(); I used this line instead and my grid displays correctly: $(window).trigger('resize');

KimberleyMeyer avatar May 01 '13 18:05 KimberleyMeyer

nice find.

ImaginaryDevelopment avatar May 03 '13 12:05 ImaginaryDevelopment