jQWidgets Forums
jQuery UI Widgets › Forums › Grid › calculating grid height
Tagged: angular grid, autorowheight, calculate row height, dynamic height, fluid size, getdisplayrows, grid, grid height, jquery grid, jqxgrid, word wrap
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 9 years ago.
-
Authorcalculating grid height Posts
-
Hi, I need to calculate the grid height based on the actual row height of each displaying row in the grid.
First, it seems that the getdisplayrows method always return the same number of rows as the getrows method, regardless of the current pagesize selected by user and the current page number.
Let’s say there are total 7 rows returned by the getrows method, and the current pagesize is 5 and the grid is displaying the second page,
is there a API method that returns the array for the last two rows.Second, the actual row height of each row can be different because the autorowheight is set to true to allow some column’s long
text to be wrapped when the column width is not big enough for displaying it in one line. Is there a API method to get the actual row height for each row?Lastly, the calculated total row height will be compared with the browser window’s available height and the smaller value will be set as the grid
height in order to avoid the browser’s vertical scroll bar from appearing. I am thinking that the grid height should be calculated and set whenever the following four events occur.1) the jqxGrid’s bindingcomplete event
2) the jqxGrid’s pagesizechanged event
3) the jqxGrid’s pagechanged event
3) browser window’s resize eventAre these the current timings in respect of the API methods that could be suggested?
Hi Kalvin,
- Thank you for your feedback. We will investigate why the method getdisplayrows is not affected by the grid’s paging and if we confirm this as an issue, we will fix it as soon as possible. Still, it is affected by the applied sorting and filtering so you can use it along with the method getpaginginformation to get only the rows on the current page.
- Unfortunately, there is no such method in jqxGrid’s API.
- We suggest you set the grid’s height to a percentage value to achieve this effect. A demo on the matter is presented here: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/autosize.htm?light.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.