Opened 13 years ago

Closed 13 years ago

#7804 closed defect (wontfix)

Setting "width" attribute to "auto" in 1.2 DataGrid markup has no effect.

Reported by: rickoshay Owned by: Nathan Toone
Priority: high Milestone: future
Component: DojoX Grid Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:


Setting the width to "auto" in the markup for a DataGrid? has no effect; setting the width attribute to "auto" in a programmatic declaration does produce an effect. The column headings exist in markup, so at the very least it should be able to auto-size each column. Using "auto" in a programmatic declaration does cause the headings to expand to fit the column text.

A secondary issue is that, even the programmatic version, does not auto-size to the widest data display value in its column, as tables typically do.

Needless to say, setting a fixed width in pixels on a text field should be avoided like the plague, but that's the only thing that seems to work in either case.

Could this be a life-cycle issue? That is, when are the data available versus when the parser sets the size? I tried doing explicit parse in the OnLoad?, same results.

Change History (6)

comment:1 Changed 13 years ago by bill

Component: GeneralDojoX Grid
Owner: changed from anonymous to Bryan Forbes

comment:2 Changed 13 years ago by Nathan Toone

Owner: changed from Bryan Forbes to Nathan Toone

Reassigning to me

comment:3 Changed 13 years ago by Nathan Toone

Milestone: tbdfuture

comment:4 Changed 13 years ago by Dom Derrien

While running the test .../dojox/grid/tests/test_data_grid.html, for example, I can see the columns "Type" correctly rendered in Firefox and Chrome, but defaulting on fixed width in Internet Explorer :(

Problem in 1.2.3 and still in 1.3.beta1.

A+, Dom

comment:5 Changed 13 years ago by Dom Derrien

While continuing my investigations to fix the discrepancy, I changed width="auto" column setting by a percentage values (width="50%", for example). Now tables can take the entire available width, and the updated columns are larger than the default width!

This is not the perfect fix, but it does the trick ;)

A+, Dom

comment:6 Changed 13 years ago by Nathan Toone

Resolution: wontfix
Status: newclosed

Closing since you mentioned the workaround. Reopen with a test case if you have one that you would like to attach for an example.

There are other bugs about setting column and view widths to "auto" that are being addressed in other locations.

Note: See TracTickets for help on using tickets.