Friday, 6 September 2013

KendoUi Grid setting pagesize in databound

KendoUi Grid setting pagesize in databound

I have a kendo grid which gets data and also font settings from the
server. The user has the option of either using scrolling or paging, but
not both.
The problem is that when I set the font for the appropriate cells, that
makes these rows bigger, so the rows no longer all fit inside the grid
content area.
What I'm doing at the moment is all in the dataBound event:
Set the styling.
Given this styling, calculate how many rows can fit in the content.
If the calculated row count doesn't match the dataSource.pageSize, set the
dataSource.pageSize as this value.
The problem is that the pageSize method resets the grid (thereby calling
dataBound (only sometimes?!)), removing the styling and also the dataBound
becomes unbound somehow.
I have a jsfiddle which fails in a different manner but I think for the
same reasons as my program, but if someone could tell me how to get it
working I could apply the logic to my program.
http://jsfiddle.net/y6vMx/5/

No comments:

Post a Comment