6pac / SlickGrid

A lightning fast JavaScript grid/spreadsheet
https://stackblitz.com/github/6pac/SlickGrid/tree/master/vite-demo
MIT License
1.84k stars 423 forks source link

fix: regression, Row Detail no longer displayed after CSP safe code #947

Closed ghiscoding closed 10 months ago

ghiscoding commented 10 months ago

with the CSP safe code implementation, the SlickRowDetail stopped working because it was using a hack. The hack was to using html string and add closing div tag to fall outside the .slick-cell but now that we use native HTML element then this hack no longer works. What we can do now is to add an optional insertElementAfterTarget that will provide a way to insert our Row Detail container element after our target which is this case is the .slick-cell

TODOs

before

image

after

image

the issue was because we append everything into the .slick-cell HTML element inside it but SlickRowDetail was hacking the html string to insert the HTML element after the .slick-cell. So our new code will simply do it in the correct way via insertElementAfterTarget

we can see below, the .dynamic-cell-detail div is supposed to go after the .slick-cell.l0.r0 but was instead within it which was wrong and causing the regression image