Opened 11 years ago
Closed 10 years ago
#11381 closed defect (invalid)
Setting with new grid structure with percentage widths does not render property
Reported by: | cerelisa | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | DojoX Grid | Version: | 1.4.1 |
Keywords: | Grid setStructure() | Cc: | |
Blocked By: | Blocking: |
Description
When using a DataGrid?, I initially set the structure to a default layout until the table column model can be retrieved from the server. I then call setStructure() to set the new table header layout. If the new structure uses percentages as the value of the column width, then the table headers are not rendered correctly. The initial column is not rendered.
I'm attaching a sample test case to illustrate the problem. Note that the grid structure is initially set to "initLayout" which only has 1 column. After grid.startup() is called, grid.setStructure() is called with the new layout. The table new structure should have 4 columns, but only 3 columns are rendered.
Note that if you change the column widths to pixels, then all 4 columns are rendered.
Attachments (2)
Change History (6)
Changed 11 years ago by
Attachment: | test_grid_programmatic_ccb.html added |
---|
comment:1 Changed 10 years ago by
This issue should be described as "1st column is not rendered in multiple view mode when column widths are in % form.
Uploading a simper test case to reproduce it.
Changed 10 years ago by
Attachment: | test_grid_programmatic_multiview_width_issue.html added |
---|
A simper test case to reproduce it
comment:2 Changed 10 years ago by
Owner: | changed from bryanforbes to Bryan Forbes |
---|
comment:3 Changed 10 years ago by
This issue still exists, but there is a workaround(below) to (only) fix similar issue occurs in test_grid_programmatic_ccb.html. Still not a complete solution since it doesn't help on issues in test_grid_programmatic_multiview_width_issue.html.
var fixView = function(v){ v.getContentWidth = function(){ return Math.max(0, Math.max(dojo._getContentBox(v.domNode).w, v.getColumnsWidth()) - v.getScrollbarWidth()) + 'px'; }; }; var grid = new dojox.grid.DataGrid({...}, div); dojo.forEach(grid.views.views, fixView); dojo.connect(grid.views, 'addView', fixView); grid.startup(); //or we can also do further setStructure() grid.setStructure(layout);
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.7 |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Has taken a close look at this, it's actually caused by an inappropriate usage - explicit view width are required when laying out Grid in percentages, also added this info to campus doc
Test case to illustrate setStructure() bug