I am developing an application that will generate a dgrid with variable column numbers and widths determined by user input. Please refer to the screenshots below for examples. The first screenshot displays a dgrid with only a few select fields, rendering neatly across the screen horizontally. In contrast, the second screenshot shows a dgrid with numerous select fields, resulting in cluttered data as it tries to fit everything on one screen. It's important to note that the dgrid is contained within a dijit BorderContainer.
Screenshot 1 (Small SELECT fieldset, renders correctly)
Screenshot 2 (Large SELECT fieldset, renders poorly)
While there are several issues at play here, my primary question is:
- Is there a CSS rule or another method, such as a dgrid function or event, that can be used to ensure cells expand to accommodate their content without cutting off any data (i.e., no overflow)? This would require the grid to display a horizontal scrollbar. I attempted using
, but this approach was ineffective. It seems as though a span element may need to be added inside each cell with the specified CSS rule?.dgrid-cell { white-space:nowrap; }
- Additionally, determining when to apply the above rule versus allowing the table to use 100% width when the data fits within the screen may present a secondary challenge. Any suggestions on how to address this issue?
Thank you.