mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.98k forks source link

Default row height calculation based on css class "slick-cell" #278

Open r0b- opened 12 years ago

r0b- commented 12 years ago

Hi,

currently I'm using this code to calculate my row-height:

        var options = {
            ...
            rowHeight: slickCellTemp.outerHeight(),
            ...
        };
        slickCellTemp.remove();

Maybe sth like this could be integrated as default behaviour?

thanks rob

mleibman commented 12 years ago

The measurement needs to account for how all the styles work together in a document - the height can be set or be affected by the styles on .slick-row, .slick-viewport .slick-cell or even an arbitrary selector including a parent container. We need to add an entire row and add it to the grid.

Still, I wonder if this is enough. You're basing the measurement on a fixed cell content. It's possible that the user needs a row height that will accomodate a different content size.

r0b- commented 12 years ago

hmm ok you're right - it should be better to add the whole row/cell-structure... Allthough the results could be still wrong due to other styles I think this should be ok for a default value?!

athingisathing commented 12 years ago

I had to not use slick grid because i could not get the row hight grow with data acordingly. I made a simple grid using knockouts simple grid and without any formatting both kogrid and my simplgrid format the height correctly out of the box.

am i missing something in slickgrid because i would rather use slick grid then most any alternative..,..butttt i can get it to format correctly. is it as simple as css wrapp and such settings??

right now i switch to kendo ui but i would rather be using slick.

please let me know

mleibman commented 12 years ago

SlickGrid requires all rows to have a fixed height, therefore, they cannot "grow with data".

athingisathing commented 12 years ago

how does it afect speed to have scc size the row height?? is there something int the div grid slick uses that woudl not allow that?

mleibman commented 12 years ago

SlickGrid absolutely positions all the rows and having fixed row sizes lets it virtualize the grid, enabling it to support millions of rows.