KoGrid
KoGrid copied to clipboard
Grid fails to size or resize properly if initially rendered hidden
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();
}
});
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"?
I put it in my main ko model
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');
nice find.