EasyUI Forum
September 15, 2025, 07:22:07 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid height and pagination  (Read 18778 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: March 04, 2013, 05:42:39 AM »

I am having problems with datagrid height and pagination.

All users have different size / height screens and therefore it is not practical to hard code EVERY table height into the HTML Markup when you want the datagrid to fill all of the available containers' innerHeight.

The containing div (panel) has it's overflow set to hidden, the reason is that this application is intended to display all of it's data without the need for the user to scroll the main panel vertically, so child elements need to handle their own vertical scrolling.

The problem is that when I change the pagesize of a datagrid that does not have it's height set in the html markup code <table style="height:1000px">, the datagrid overflows the containing div and the bottom of the grid is then hidden, and vertical scroll bars are not added to the datagrid.

Setting the table height to 100% also does not work, and setting the table's container div to a fixed height also does not prevent the pagination from extending beyond the size of it's container.

To try and overcome this, I have tried to calculate the available innerheight and set the datagrid height to be equal to that, however It appears that you cannot override the datagrid.height programatically using for example $('#someid').height = '500px' or $('#someid').css('height','500px'), and that the datagrid height can only be hard-coded in the HTML markup before the object is created.

I have also tried calling datagrid('resize') after changing the height / style.height but that appears to have no effect.

forcing overflow:scroll on the .datagrid-body also won't work, although it makes a vertical scroll bar visible, the horizontal scroll overflows and is hidden.

How can I solve this ??

Thanks

« Last Edit: March 04, 2013, 05:53:21 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 05, 2013, 07:56:21 AM »

Set the table's container div to a fixed height and then set 'fit:true' to the datagrid. Once the datagrid has the 'fit' property set to true, it will resize to full fill its container and the vertical scroll bar will disappear.

Code:
<div style="height:300px">
<table class="easyui-datagrid" fit="true" ...>
</table>
</div>
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: March 05, 2013, 09:08:06 PM »

Thanks for the help, but unfortunately this won't work.

I need for the table and it's container, to fill 100% of the available browser height and width so that the whole of the area to the bottom of the browser's window is filled completely with the table, and as everyone's browser is a different height, I cannot set the height of the datagrid's container, to other than 100%.

I can set the vertical height using javascript, but the datagrid still extends beyond it's container and does not add the scroll bars to the datagrid.

I have also just realized that the datagrid object is adding the ".panel-noscroll" to the datagrid's parent, this appears to be causing some of the problems.

I have tried to replicate the problem on jsfiddle, but it's quite difficult due to the cross domain ajax problem, the only way that I can really think of is to let you see the page for yourself.

Can I send you a personal message with the details ??
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: March 05, 2013, 11:12:23 PM »

To have the datagrid fill all the browser window, try the code below:
Code:
<body>
<table class="easyui-datagrid" fit="true" ...></table>
</body>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!