EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 16, 2024, 09:38:05 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Datagrid automatic width
Pages: [
1
]
« previous
next »
Print
Author
Topic: Datagrid automatic width (Read 7612 times)
x3no
Newbie
Posts: 5
Datagrid automatic width
«
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
Re: Datagrid automatic width
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...