How to add empty, non-selectable rows to a slickgrid?
I'm using Slickgrid to display tabular data retrieved via JSON. The number of the grid items varies greatly (approx. 1 - 50 grid rows) and the grid is reloaded often with new data during the page lifecycle.
To make my grid less "jumpy" (i.e. to avoid frequent changes of the grid height), I'd like to display the grid with a constant height of 10 rows. If the JSON resultset is less than 10 items, the grid shou开发者_运维技巧ld be filled up with empty rows. If it is more than 10 rows, I want to activate paging.
I already figured out how to fill up the grid with empty rows, however I don't want these to be selectable or editable. How can I achieve this?
Instead of loading it up with empty rows, why don't you just use a little bit of CSS?
div.slick-viewport {
height: 100px; /* or whatever 10*row_height is */
}
精彩评论