EasyUI Forum
April 29, 2024, 08:58:27 AM *
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 automatic width  (Read 7591 times)
x3no
Newbie
*
Posts: 5


View Profile Email
« on: September 23, 2013, 11:29:39 PM »

Hello,

The issue I am facing is as follows:
Datagrid pager and header take 100% of the page width, while actual data columns take much less
space.
So datagrid-btable is 487px wide which is exactly how wide I want my datagrid to be.
In the meantime datagrid-body and the rest of divs are 1888px wide.

Whats the best way to make the whole datagrid as wide as datagrid-btable?

I considered resize function, but can't seem to find an event (after datagrid widths are set) on which to fire it.
Logged
x3no
Newbie
*
Posts: 5


View Profile Email
« Reply #1 on: September 25, 2013, 05:51:08 AM »

The best solution I managed to come up with is this function:
   function resizeDg() {
        $('#dg').datagrid('resize', { width: $('.datagrid-btable').width()+2 });
    }

For now it is being called after right after data load (had to override the loader and put it right after _698(data)), and works most of the time.
However it still performs the resize incorrectly when there is a delay between the moment when data is loaded and the moment when data rows are displayed with calculated width.

So the questions still stand.
Is there a better way do to this?
Is there an event that fires once rows are displayed with calculated width?
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!