[CLOSED] Locking Grid with checkboxselection model

  1. #1

    [CLOSED] Locking Grid with checkboxselection model

    Hi,

    I have a grid panel with checkboxselection model. I want to lock first column, i setted Locked = "True" property. But the problem is Checkboxed shifted next to first column.

    Is there anyway i can move the checkbox column to first column. I check many threads but didnot get right solution.

    attached image for your refernceClick image for larger version. 

Name:	Grid.JPG 
Views:	129 
Size:	7.6 KB 
ID:	3936

    Thanks in Advance
    Last edited by Daniil; Mar 15, 2012 at 8:03 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please investigate the following thread:
    http://forums.ext.net/showthread.php?13509
  3. #3
    Hi Daniil,

    Thanks for the informaion. Already i checked that thread. I dont want to move the freezed column to right. It should be in left side but after to checkbox column.

    so you mean that is not possible to implement is it ?

    Thanks
  4. #4
    Well, anything is possible :)

    Just for you since you are a premium member :)

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3" },
                    new object[] { "test4", "test5", "test6" },
                    new object[] { "test7", "test8", "test9" },
                };
                store.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var myIsLocked = function (colIndex) {
                var c = this.config[colIndex];
    
                if (c instanceof Ext.grid.CheckboxSelectionModel) {
                    
                    return true;
                }
    
                return this.config[colIndex].locked === true;
            };
    
            var onViewReady = function (grid) {
                var sm = grid.getSelectionModel();
                
                Ext.fly(grid.getView().innerHd).un("mousedown", sm.onHdMouseDown, sm);
                Ext.fly(grid.getView().lockedHd).on("mousedown", sm.onHdMouseDown, sm);
            };
    
            var myCheckHeader = function () {
                var view = this.grid.getView(),
                    t = Ext.fly(view.lockedHd).child(".x-grid3-hd-checker"),
                    isChecked = t.hasClass("x-grid3-hd-checker-on");
    
                if (!isChecked) {
                    t.addClass("x-grid3-hd-checker-on");
                }
            };
    
            var myUncheckHeader = function () {
                var view = this.grid.getView(),
                    t = Ext.fly(view.lockedHd).child(".x-grid3-hd-checker"),
                    isChecked = t.hasClass("x-grid3-hd-checker-on");
    
                if (isChecked) {
                    t.removeClass("x-grid3-hd-checker-on");
                }
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" Height="200">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test1" />
                                    <ext:RecordField Name="test2" />
                                    <ext:RecordField Name="test3" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test1" DataIndex="test1" Locked="true" />
                        <ext:Column Header="Test2" DataIndex="test2" />
                        <ext:Column Header="Test3" DataIndex="test3" />
                    </Columns>
                    <CustomConfig>
                        <ext:ConfigItem Name="isLocked" Value="myIsLocked" Mode="Raw" />
                    </CustomConfig>
                </ColumnModel>
                <View>
                    <ext:LockingGridView runat="server" />
                </View>
                <SelectionModel>
                    <ext:CheckboxSelectionModel runat="server">
                        <CustomConfig>
                            <ext:ConfigItem Name="checkHeader" Value="myCheckHeader" Mode="Raw" />
                            <ext:ConfigItem Name="uncheckHeader" Value="myUncheckHeader" Mode="Raw" />
                        </CustomConfig>    
                    </ext:CheckboxSelectionModel>
                </SelectionModel>
                <Listeners>
                    <ViewReady Fn="onViewReady" />
                </Listeners>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  5. #5
    Hi Daniil,

    With your support everything is possible :-)

    Thanks it works awesome.

Similar Threads

  1. Replies: 1
    Last Post: Feb 03, 2011, 2:49 PM
  2. [CLOSED] CheckboxSelection model - select a row from codebehind
    By sadaf in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 07, 2011, 9:24 AM
  3. CheckboxSelection Model Event
    By BLOZZY in forum 1.x Help
    Replies: 2
    Last Post: Sep 07, 2010, 7:40 AM
  4. [CLOSED] CheckBoxSelection model
    By jwaite in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 17, 2010, 7:33 AM
  5. [CLOSED] CheckboxSelection model and script in every response
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 04, 2009, 11:09 AM

Tags for this Thread

Posting Permissions