EasyUI Forum
September 16, 2025, 04:06:39 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: Autosize datagrid columns  (Read 18555 times)
zolotoy
Jr. Member
**
Posts: 89


View Profile Email
« 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


View Profile Email
« 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


View Profile Email
« 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


View Profile Email
« 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


View Profile Email
« 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


View Profile Email
« 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  
 
Jump to:  

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