Gridpanel Column width based on column content?

  1. #1

    Gridpanel Column width based on column content?

    Hello,
    I have a very simple grid panel that shows a ticket's comments. The comments are variable lengths.
    I don't want to set a column width to encompass the max comment size as its ugly in instances where the comments are very brief/terse.

    I'd prefer if possible the ability to horizontally scroll ONLY when the comments column is larger than what fits in the gridpanel.

    Here is my code and a screenshot of what I mean.
    <ext:Panel ID="pnComments" runat="server" Width="550" Height="200" Title="Comments"
                                Layout="Fit" Icon="Table">
                                <Items>
                                    <ext:GridPanel ID="gpComments" runat="server" Border="false" BodyStyle="background-color:transparent"
                                         AutoExpandColumn="Comments">
                                        <Store>
                                            <ext:Store ID="sComments" runat="server">
                                                <Reader>
                                                    <ext:JsonReader>
                                                        <Fields>
                                                            <ext:RecordField Name="TimeStamp" Type="Date" />
                                                            <ext:RecordField Name="NTLogin" />
                                                            <ext:RecordField Name="Text" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ColumnModel>
                                            <Columns>
                                                <ext:DateColumn DataIndex="TimeStamp" Format="MM-dd-yy HH:mm:ss tt" Header="Submitted On"
                                                    Width="120" />
                                                <ext:Column DataIndex="NTLogin" Header="Submitted By" Width="120" />
                                                <ext:Column ColumnID="Comments" DataIndex="Text" Header="Comment" Width="400" />
                                            </Columns>
                                        </ColumnModel>
                                    </ext:GridPanel>
                                </Items>
                            </ext:Panel>
  2. #2
    Hi,

    There is no such functionality.
    I'd prefer if possible the ability to horizontally scroll ONLY when the comments column is larger than what fits in the gridpanel.
    I can suggest you:

    1. To use a ToolTip for that column, like this:
    https://examples1.ext.net/#/Miscella..._Cell_Tooltip/

    or

    2. To use a "Details" button in that cell, like this:
    https://examples1.ext.net/#/GridPane.../Cell_Command/

Similar Threads

  1. Replies: 1
    Last Post: Jun 11, 2012, 11:59 AM
  2. Replies: 6
    Last Post: Jun 11, 2010, 12:47 PM
  3. [CLOSED] Icon column in GridPanel based on column from store
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 12, 2010, 5:46 PM
  4. Replies: 4
    Last Post: Aug 04, 2009, 11:37 AM
  5. Replies: 2
    Last Post: Jun 01, 2009, 2:26 PM

Posting Permissions