JLynch7 / SlickGrid

A lightning fast JavaScript grid/spreadsheet
https://github.com/jlynch7/SlickGrid/wiki
MIT License
89 stars 76 forks source link

Adding a new row via field in frozen columns section of example-frozen-columns leads to mismatching left/right #59

Open whelaro opened 10 years ago

whelaro commented 10 years ago

Steps:

go to http://jlynch7.github.io/SlickGrid/examples/example-frozen-columns.html

scroll to bottom, enter editor mode of Title, and enter test data. press enter.

fix, just one line (bottom one. In fact, don't reproduce my entire bit as I've extended it to use textbox data for Title1-Title4):

  grid.onAddNewRow.subscribe(function (e, args) {
    var item = {
        "num": data.length + 1, "id": data.length, "title": "New task", "duration": "1 day", "percentComplete": 0, "start": "01/01/2009", "finish": "01/01/2009", "effortDriven": false,
                "title1": $('#item1').val(), "title2": $('#item2').val(), "title3": $('#item3').val(), "title4": $('#item4').val()};
    $.extend(item, args.item);
    dataView.addItem(item);
    grid.invalidate();
    grid.scrollRowIntoView(grid.getDataLength(),true);
});