1
votes

I'm new to slickgrid. I have a problem with refreshing the grid : just a table with 2 columns "id" and "value". the grid is populated behind the scene like this :

        cpt ++ ;
        var d = [{ id: "item" + cpt, value: "val" + cpt }, ];
        data.push(d[0]);
        grid.updateRowCount();
        grid.render();

the data is updated and can be controled :

        var n = grid.getData().length;
        var t;
        for (var i = 0; i < n; i++) {
            t = t + '\n' + grid.getData()[i].id + ' --> ' + grid.getData()[i].value;
        }
        alert(t);        

but on the screen the new rows are empty. If I edit a row the data appear. if I create lot of rows and use the slider to browse the grid, some data appear but not all.

I thought that "grid.render();" should render the grid with the new data ? I miss something, do I need something more like "grid.refresh ?"

regards

some news :

By raising and lowering the slider several times quickly, all data appear.

ok, the solution :

enableAddRow: false

1
You might want to include some more details here. What's the rest of the code look like? What slider are you talking about? What's with the extra comma in the initial data array?Tin

1 Answers

4
votes

I think that using this

grid.setData(data);
grid.render();