jQuery UI Widgets Forums Grid calculating grid height

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 4 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • calculating grid height #85329

    Kalvin
    Participant

    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 event

    Are these the current timings in respect of the API methods that could be suggested?

    calculating grid height #85336

    Dimitar
    Participant

    Hi Kalvin,

    1. 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.
    2. Unfortunately, there is no such method in jqxGrid’s API.
    3. 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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.