KoGrid icon indicating copy to clipboard operation
KoGrid copied to clipboard

Columns overlap in 2.1.1 when loading data over JSON

Open onethread opened this issue 12 years ago • 2 comments

I've been trying to load JSON data through AJAX, and the data would load, but all the columns in the grid would overlap each other. After much fiddling of the existing examples on plunker: http://embed.plnkr.co/usa2JIgkviFSOdsvqq8E/preview

Toggling between the previous version here: http://ericmbarnard.github.com/KoGrid/lib/KoGrid.debug.js and 2.1.1 causes the error to manifest. Sorry for hot linking right to the raw, couldn't figure out where else to find the link.

Bug occurs in FF 10 and the latest Chrome.

onethread avatar Feb 13 '13 16:02 onethread

try something like this in the first ajax load success after you load the data:

  //fix for kogrid FAIL when first initialized hidden
    var initializedgrid = false;
    self.isInboxVisible.subscribe(function (newValue) {
        if (newValue === true && !initializedgrid) {
            initializedgrid = true;
            ko.contextFor($('.koGrid').first().children()[0]).$data.init();
        }

    });

probably just the line

ko.contextFor($('.koGrid').first().children()[0]).$data.init();

ImaginaryDevelopment avatar Apr 18 '13 13:04 ImaginaryDevelopment

likely duplicate of https://github.com/Knockout-Contrib/KoGrid/issues/183

ImaginaryDevelopment avatar Apr 18 '13 13:04 ImaginaryDevelopment