[CLOSED] Column name for the header checkbox

  1. #1

    [CLOSED] Column name for the header checkbox

    How to get column name for the header checkbox in a grid panel.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	161 
Size:	28.2 KB 
ID:	23931

    As in the above image, I need to have a column name(In Use) for the check box list in the grid.
    Last edited by Daniil; May 01, 2015 at 1:37 PM. Reason: [CLOSED]
  2. #2
    Hi @arjunrvasisht,

    Please look at the example.

    Example
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <style>
            .my-checkbox-header .x-column-header-text span {
                font-size: 11px;
                padding-left: 18px;
            }
        </style>
    
        <script>
            Ext.selection.CheckboxModel.override({
                getHeaderConfig: function() {
                    var config = this.callParent(arguments);
    
                    if (this.headerText) {
                        config.text = "<span>" + this.headerText + "</span>";
                        config.cls += " my-checkbox-header";
                    }
    
                    return config;
                }
            });
        </script>
    
        
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:GridPanel ID="GridPanel1" runat="server">
                <Store>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test1" />
                                    <ext:ModelField Name="test2" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="Test 1" DataIndex="test1" />
                        <ext:Column runat="server" Text="Test 2" DataIndex="test2" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:CheckboxSelectionModel runat="server" HeaderWidth="60">
                        <CustomConfig>
                            <ext:ConfigItem Name="headerText" Value="In Use" Mode="Value" />
                        </CustomConfig>
                    </ext:CheckboxSelectionModel>
                </SelectionModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  3. #3
    Click image for larger version. 

Name:	headerCB.PNG 
Views:	113 
Size:	6.0 KB 
ID:	23932

    Hi Daniil, I have used the code u have sent. But this is how it is being displayed. the word 'Use' in 'In Use' is coming in the second line.
  4. #4
    You probably should increase the CheckboxSelectionModel's HeaderWidth setting a little bit.

Similar Threads

  1. Replies: 0
    Last Post: Nov 20, 2014, 9:00 AM
  2. [CLOSED] Checkbox Column header in GridPanel
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 12, 2014, 8:16 PM
  3. Replies: 1
    Last Post: Aug 02, 2013, 7:16 PM
  4. [CLOSED] Checkbox in Gridpanel Column Header
    By RCM in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 24, 2012, 11:49 PM
  5. Replies: 3
    Last Post: Aug 13, 2010, 4:25 PM

Tags for this Thread

Posting Permissions