EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 16, 2025, 01:50:00 PM
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
>
Autosize datagrid columns
Pages: [
1
]
« previous
next »
Print
Author
Topic: Autosize datagrid columns (Read 18549 times)
zolotoy
Jr. Member
Posts: 89
Autosize datagrid columns
«
on:
July 12, 2015, 04:38:34 AM »
Is there a way to have datagrid autosizing its columns in such a way they will take all available space? So, if a datagrid has just one column it will have its width equal to grid's width.
Thanks
Logged
jarry
Administrator
Hero Member
Posts: 2298
Re: Autosize datagrid columns
«
Reply #1 on:
July 12, 2015, 07:06:22 PM »
Just set the 'fitColumns' property to true, or use the datalist component instead.
Logged
zolotoy
Jr. Member
Posts: 89
Re: Autosize datagrid columns
«
Reply #2 on:
July 13, 2015, 03:07:49 AM »
fitColumns allocates enought space to snow data, but it does not take all grid's width See attached.
Logged
jarry
Administrator
Hero Member
Posts: 2298
Re: Autosize datagrid columns
«
Reply #3 on:
July 13, 2015, 07:22:27 AM »
You must set width for each columns. If your issue continues, please show some code snippets to demonstrate your issue.
Logged
zolotoy
Jr. Member
Posts: 89
Re: Autosize datagrid columns
«
Reply #4 on:
July 13, 2015, 07:38:45 AM »
Well, yes, I can set column widths to some concrete values. But that's not a good way of designing things. Concrete values can cause problems on different screen resolutions.
I am attaching another screenshot where it works automatically.
Logged
jarry
Administrator
Hero Member
Posts: 2298
Re: Autosize datagrid columns
«
Reply #5 on:
July 13, 2015, 09:31:57 AM »
You can assign percentage width to a column in DataGrid. If you have only one column, set 100% width for it.
http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=Fluid%20DataGrid
Please search the answers from the forum or tutorials or demos before posting your question.
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...