EasyUI Forum
June 19, 2024, 04:25:54 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: Set pageSize of grid depends on screen height  (Read 15773 times)
manojvijayan
Newbie
*
Posts: 13


View Profile Email
« on: November 21, 2012, 09:38:04 PM »

I have created a grid panel using Easy UI. The grid panel is fit to all screens.The page size of grid is 20. In small screens, the grid has scrolling. In wide screen,there is some blank space between last record  and pagination tool even though there is more than 20 records.In this blank space, we can accommodate 4 or 5 records.

Please see the attached file.There is 2 pages [25 records]. First page shows 20 records. Some blank space is shown after the 20th record.

I want 15 records for small screens and 25 records for wide screens.There should not be scroll bar and blank space.

How can dynamically set the pageSize of grid depends on screen height or grid height ?
Is there any function to get the height of grid panel?
« Last Edit: November 21, 2012, 09:41:43 PM by manojvijayan » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 22, 2012, 02:35:48 AM »

Notice that your datagrid is placed on center panel of layout. The code below can get the datagrid outer height.
Code:
var height = $('body').layout('panel','center').height();
alert(height);
Another way to get the height of datagrid is to get the outer panel of datagrid and then get its height.
Code:
var height = $('#dg').datagrid('getPanel').panel('panel').outerHeight();
alert(height);
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #2 on: December 06, 2012, 02:55:36 AM »

Thanks I"ll use the panel height to hide the vertical scrollbar when possible Smiley
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!