Comments (34)
Have you considered default autosizing to the Column headers if they are larger than the cell contents?
-> yes, it's no my list.
from ag-grid.
When you get around to doing this, I would love to see at least 4 "modes" for auto-sizing of columns.
- None (current behaviour)
- Fit Header (just wide enough to fit heading text in)
- Fit Contents (just wide enough to fit largest contents)
- Fit Header & Contents (wide enough to show all data without truncation)
I assume fitting the contents in will be the hardest, since that could change as new data gets loaded in. It would also be the slowest, due to having to measure each cell to get the width.
from ag-grid.
When you implement taking into account header for auto-size, would you consider doing it as an optional parameter in the api?
columnApi.autoSizeColumns(columns, includeHeadersBoolean)
There are times where it's nice to hide long column names to display more data. It would be nice to have the option to include or ignore headers when determining the size.
from ag-grid.
@ceolter Hi, sorry to bump up this thread but I can't seem to find if it has been implemented or not ? (Fit to the header's title in case its content is larger)
from ag-grid.
Possible dupe of #7 ?
from ag-grid.
I don't think it's a dupe.
#7 is suggesting making columns expand to fill the width of the parent div.
#41 is suggesting making a column expand to fit it's own content.
from ag-grid.
Ah, gotcha. Thats gonna be tough to achieve performantly.
from ag-grid.
Reckon we can break some rules to make it quick, eg assume fixed pixels per
text character (assumes plaintext default cell rendering), or could just
sample first 100 rows (render them off page, get max width of result).
On 6 Apr 2015 19:33, "Austin" [email protected] wrote:
Ah, gotcha. Thats gonna be tough to achieve performantly.
—
Reply to this email directly or view it on GitHub
#41 (comment).
from ag-grid.
Ya, but if you enable templates and whatnot it gets expensive fast and bug prone. Does slickgrid do this?
from ag-grid.
yes slickgrid has it:
http://stackoverflow.com/questions/6794656/how-do-i-autosize-the-column-in-slickgrid
also excel has it, ie double-click the RHS of the column header, would be
pretty cool if the grid did this.
On 6 April 2015 at 23:12, Austin [email protected] wrote:
Ya, but if you enable templates and whatnot it gets expensive fast and bug
prone. Does slickgrid do this?—
Reply to this email directly or view it on GitHub
#41 (comment).
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Statements and opinions expressed in this e-mail may not
represent those of the sender. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender immediately and delete
the material from any computer.
from ag-grid.
Looks like it does force fill and autosize! Just steal their code ;)
It would be really tricky to get 'row height' sizing with infinite scrolling!
from ag-grid.
not doing auto-row height - that's fixed - just width
don't think i'll take their code, just get inspired by the ideas!!
On 6 April 2015 at 23:21, Austin [email protected] wrote:
Looks like it does force fill and autosize! Just steal their code ;)
It would be really tricky to get 'row height' sizing with infinite
scrolling!—
Reply to this email directly or view it on GitHub
#41 (comment).
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Statements and opinions expressed in this e-mail may not
represent those of the sender. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender immediately and delete
the material from any computer.
from ag-grid.
👍 This would be great
from ag-grid.
This would be so cool, any news on this @ceolter ?
from ag-grid.
no closer to doing this i'm afraid. still on my to-do list.
from ag-grid.
👍
from ag-grid.
+1
from ag-grid.
+1
from ag-grid.
Any plans for this feature?
from ag-grid.
yup i still plan to do it, but i don't have the work scheduled right now.
from ag-grid.
@greglockwood you should chk out my project: https://github.com/Swimlane/angular-data-table ... its got some unique sizing techniques ... sorry @ceolter for plugging my proj ;)
from ag-grid.
@greglockwood @amcdnl lol no worries Austen. if someone thinks another grid is a better choice for them, that's fine with me. takes the pressure of some features i haven't gotten in yet!!!
from ag-grid.
@ceolter Is this candidate for v3?
from ag-grid.
@nileshmali nope
v3 is all about pinned columns (left and right) and multi level groups in the headers
from ag-grid.
Wooohoo is this what I think it is ?
from ag-grid.
this is now done, will be in the next release. if you double click the column header 'resize' bar, it will calculated the perfect width for the column.
@greglockwood i've decided to just resize the row data, not the header data, just doing the row data cells is enough to be better than the other grids.
from ag-grid.
@ocombe yup!!!! i'll release in the next few days. it works pretty dam good!!! i was banging my head for about 30min coming up with designs, then wallah, an idea sprung to my head that works!!!
from ag-grid.
Nice, can you call it programmatically as well (without having to tell the user to double click the resize bar)? For example call it once you've loaded the cells
from ag-grid.
yes. i put in two api methods, one takes one column, the other a list of columns.
from ag-grid.
That's perfect, I'll put it on the todo list for our app at work, thanks a lot !! :)
from ag-grid.
@ocombe welcome!
from ag-grid.
So has the "Fit Contents" option been added? If so, where can I get the documentation on how to use it and what version is it available in?
from ag-grid.
@mpetkov
https://www.ag-grid.com/change-log/changeLogIndex.php
3.1.0
Major: Implemented auto-size for column. Now columns can be told to fit their content.
from ag-grid.
Have you considered default autosizing to the Column headers if they are larger than the cell contents? For example, with the current autosize function, if I have a long column name and the column just has an icon in it, the name of the column is truncated.
from ag-grid.
Related Issues (20)
- AG Grid Upgrade Issue - Tab Navigation Problem HOT 2
- Fill handle with filloperation provided uses formatted value instead of original value HOT 3
- SSRM pagination: Getting question mark "?" in the pagination HOT 2
- When using `agMultiColumnFilter` on a date string, `agSetColumnFilter` cannot be applied. HOT 2
- I get error 404 for the latest version of ag grid HOT 4
- How do I merge columns by clicking
- ag-grid-react.js AG Grid: Looking for component [] but it wasn't found HOT 1
- ag-grid-react 31.2.0 - Module not found: Error: Can't resolve 'react-dom/server' - Did you mean 'server.browser.js'? HOT 6
- TypeError next(@ag-grid-community/csv-export/dist/package/main.esm) HOT 4
- Refresh issue of fullwidthrows in 31.0.3 HOT 3
- Why was 31.2 republished? HOT 2
- Cell editing cannot be opened if stopEditingWhenCellsLoseFocus is set to true HOT 1
- ag-grid-solid not updated to 31.2.0 or error in documentation ? HOT 7
- From 31.2.0 the aggregated column is not longer visible on my group data using server side HOT 1
- Misnomer with theming variable --ag-cell-horizontal-border HOT 1
- Pagination problem | pageLastRowUnknown HOT 5
- Uncaught TypeError: filterInstance.onFloatingFilterChanged is not a function HOT 2
- Table goes empty if filter options are not available after data update HOT 4
- Chart theme overrides for the axes don't work when grid data is grouped HOT 3
- Enabling pagination configuration results in abnormal pagination display. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ag-grid.