[CLOSED] RowEditor - Boolean columns in a Gridpanel are not editable

  1. #1

    [CLOSED] RowEditor - Boolean columns in a Gridpanel are not editable

    Gentlemen,

    I am having a little issue with RowEditor. I am not able to edit boolean values while the RowEditor is active. I can edit them outside the RowEditor just fine, but once I click a textbox or combobox and bring up the RowEditor, clicking the checkboxes does nothing.

    Here's a code example to illustrate the problem:

    <%@ Page Language="vb" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not Ext.Net.X.IsAjaxRequest Then
                Me.storItem.DataSource = New Object() {New Object() {1, "Software Package #1", "GroupCategory1", False},
                                                      New Object() {2, "Software Package #2", "GroupCategory2", False},
                                                      New Object() {3, "Software Package #3", "GroupCategory1", False},
                                                      New Object() {4, "Software Package #4", "GroupCategory2", True},
                                                      New Object() {5, "Software Package #5", "GroupCategory1", False},
                                                      New Object() {6, "Software Package #6", "GroupCategory2", True}}
               
                Me.storItem.DataBind()
            End If
        End Sub
        
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Testing</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Store ID="storItem" runat="server" GroupField="GroupCategory">
            <Reader>
                <ext:ArrayReader>
                    <Fields>
                        <ext:RecordField Name="inventoryID" Type="Int" />
                        <ext:RecordField Name="InventoryName" Type="String" />
                        <ext:RecordField Name="GroupCategory" Type="String" />
                        <ext:RecordField Name="HasImage" Type="Boolean" />
                    </Fields>
                </ext:ArrayReader>
            </Reader>
        </ext:Store>
    
        <ext:Viewport ID="Viewport1" runat="server">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <North MarginsSummary="5 5 5 5" Collapsible="true" >
                        <ext:Panel ID="Panel1" runat="server" Frame="true" Title="Filters" Layout="absolute" Height="165">
                        <Items>
                            <ext:Label ID="Label1" runat="server" Text="not used in test" X="5" Y="10" />
                        </Items>
                        </ext:Panel>
                    </North>
    
                <Center MarginsSummary="5 5 5 5" >
                    <ext:Panel ID="inventoryPanel" Frame="false" runat="server" Layout="Fit" Title="Inventory">
                    <Items>
                       <ext:GridPanel ID="GridPanel1" StoreID="storItem" runat="server" MinHeight="200" Width="2750">
                            <ColumnModel>
                                <Columns>
                                    <ext:Column DataIndex="inventoryID" Width="100">
                                        <Editor>
                                            <ext:TextField runat="server" ID="txtinventoryID" />
                                        </Editor>
                                    </ext:Column>
                                    <ext:Column DataIndex="GroupCategory" Width="200" >
                                        <Editor>
                                            <ext:TextField runat="server" ID="TextField1" />
                                        </Editor>
                                    </ext:Column>
                                    <ext:Column DataIndex="InventoryName" Width="400">
                                        <Editor>
                                            <ext:TextField runat="server" ID="TextField2" />
                                        </Editor>
                                    </ext:Column>
                                    <ext:CheckColumn DataIndex="HasImage" Editable="true" >
                                        <Editor>
                                            <ext:Checkbox runat="server" ID="chkBox1" />
                                        </Editor>
                                    </ext:CheckColumn>
                                </Columns>
                            </ColumnModel>
                            <BottomBar>
                            <ext:Toolbar runat="server">
                                <Items>
                                    <ext:Button runat="server" id="btn1" Text="test"/>
                                    <ext:Button runat="server" id="Button1" Text="test2"/>
                                    <ext:Button runat="server" id="Button2" Text="test3"/>
                                    <ext:Button runat="server" id="Button3" Text="test4"/>
                                </Items>
                            </ext:Toolbar>
                            </BottomBar>
                            <SelectionModel>
                                <ext:RowSelectionModel runat="server" ID="Selection1" />
                            </SelectionModel>
                            <Plugins>
                                <ext:RowEditor runat="server" ID="RowEditor1" />
                            </Plugins>
                        </ext:GridPanel>
    
    
                    </Items>
                    </ext:Panel>
                </Center>
    
            </ext:BorderLayout>
        </Items>
        </ext:Viewport>
        </div>
        </form>
    </body>
    </html>
    Go ahead and click the checkboxes, works fine. Then click a text area on a row to bring up the RowEditor and then click the checkboxes. Nothing happens.
    Last edited by Daniil; Feb 16, 2011 at 1:22 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Unfortunately, CheckColumn doesn't support editor, but it supports Editable="true".

    If you need edit it in RowEditor I can suggest you a common Column instead of CheckColumn. But, in this case, you could not edit it without RowEditor.

    Example
    <style type="text/css">
        .x-editor-center {
            text-align: center;
        }
        
        .x-editor-center .x-form-cb-label {
            margin-left: -2px;    
        }
    </style>
    
    <ext:Column DataIndex="HasImage">
        <Renderer Fn="meRenderer" />
        <Editor>
            <ext:Checkbox runat="server" Cls="x-editor-center" />
        </Editor>
    </ext:Column>
  3. #3
    Hi Daniil,

    Just for completeness sake can you show me what is supposed to be in the Renderer function meRenderer for the column?

    Thanks and once that has been done you can mark this one solved!

    David
  4. #4
    Apologize, somehow I missed that.

    I just took CheckColumn's renderer.

    Renderer
    var meRenderer = function (v, p, record) {
        p.css += " x-grid3-check-col-td";
        return '<div class="x-grid3-check-col' + (v ? "-on" : "") + " x-grid3-cc-" + this.dataIndex + '">&#160;</div>';
    }

Similar Threads

  1. [CLOSED] Checkbox editor with RowEditor plugin not editable.
    By pj_martins in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 10, 2011, 2:35 PM
  2. Resize RowEditor columns
    By Dominik in forum 1.x Help
    Replies: 1
    Last Post: Jul 28, 2011, 9:11 AM
  3. RowEditor plugin and resizing columns
    By Daniil in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 15, 2011, 8:38 AM
  4. [1.0] RowEditor and columns width problem
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 07, 2010, 1:56 AM
  5. [CLOSED] Boolean value as Checkbox in a GridPanel
    By fondant in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 29, 2009, 11:34 AM

Tags for this Thread

Posting Permissions