Column hidden
can cause out of sync indexes
#981
Unanswered
ghiscoding
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The strategy used for hidden columns was to behave as if they were not in the column array at all (previously we would have had an external array containing 'all' columns and pruned the hidden ones out in a copy before passing in to the grid). I was worried about how this would affect things at the time, but with some careful tweaking, it all went quite easily. Will have a look in the next day or so if you like. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@6pac when you introduced the
hidden
property for Column in PR #765, was your intention to skip the DOM element creation (column headers, cells) or was it to hide them (display: none
)? The reason I'm asking is because I was trying to troubleshoot why there's an offset in the column headers in the grid that you created withhidden
, as you can see below the hidden works correctly for the "Duration" column but it doesn't work well with the "Finish" column, it looks like the cell column is not created but the Finish header stays there. So I thought that I simply had to skip the header creation for whenhidden
is true like the code belowSlickGrid/src/slick.grid.ts
Lines 1614 to 1619 in ffbb335
but this brings other problems, there are a few (many) areas of SlickGrid that relies on the column index by using
for
loops, including some sections that read the DOM and expect the DOM elements to be at a certain index and if we skipped the header creation then these index become out of sync. For example, the code below.SlickGrid/src/slick.grid.ts
Lines 1900 to 1908 in ffbb335
So I'm not really sure on how to fix these problems. The heavy use of
for
loop with indexes has some benefits, the biggest of them all is performance, if we switch tofor..of
then there's a significant perf decrease. So what was your intention with this new approach?https://6pac.github.io/SlickGrid/examples/example-frozen-columns-and-column-group-hidden-col.html
Beta Was this translation helpful? Give feedback.
All reactions