AutoFill 2.0.0 and Row Grouping (Using drawCallBack) throws errors

AutoFill 2.0.0 and Row Grouping (Using drawCallBack) throws errors

glendersonglenderson Posts: 231Questions: 11Answers: 29

I can get AutoFill 2.0.0 to work.
I can get Row Group using drawCallBack to work.

When I put them together, however, cells[0][0].data() in the autofill plugin becomes "undefined" or the copy just doesn't work (because .data() is undefined).

Should these two features be able to work together?

http://jsfiddle.net/glenderson/bzzpf0wf/3/

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,316Questions: 1Answers: 10,226 Site admin

    Thanks for the fiddle - interestingly, it does appear to (partly) work for me (Chrome 45 Mac). I don't get any Javascript errors, but it does fill too many rows when dragging (it is counting the grouping row as well, which is wrong and iI'll fix that).

    Is there something specific I need to do to get the JS error?

    Allan

  • glendersonglenderson Posts: 231Questions: 11Answers: 29
    edited September 2015

    Hi Allan,
    It wouldn't actually throw a JS error, but instead sometimes, depending upon the fill type, would calculate the contents to be "undefined".

    I think the "undefined" issue happens when the number of displayed groups before the drag row plus the row count of the selected row exceeds the number of rows in the table. For example, if there are 3 row groups before my selected row, I select row 8 for dragging, but my table only has 10 rows; 3 + 8 =11 which exceeds 10, returns undefined. In production, I was only working with a 1 row table while developing and using my own plugin so I hit the issue all the time (1 group row + 1 selected row) = 2, which was greater than the single row in the table.

    Having group rows seems to offset everything. A wild guess on my part would be that the autofill select / fill routines need to exclude rows containing the class "group" when determining position (or has to add them depending upon how you look at it).

  • allanallan Posts: 62,316Questions: 1Answers: 10,226 Site admin
    Answer ✓

    Yup - that sounds like the error I was seeing as well. I'll try to make some time this week to look into it.

    Allan

  • glendersonglenderson Posts: 231Questions: 11Answers: 29

    The selecting of the rows is now corrected when row grouping is used in the latest nightly build. Thanks!

This discussion has been closed.