[CLOSED] GridPanel Column Editor PLUGIN: disable Enter KEY on default button Update and Cancel'

  1. #1

    [CLOSED] GridPanel Column Editor PLUGIN: disable Enter KEY on default button Update and Cancel'

    Hi again,

    I couldn't get the following simple example to work after adding Daniil suggestion about whole disabling of the enter key adding AfterRender Handler.


            <Listeners>
                <AfterRender Handler="this.editingPlugin.editor.on('afterrender', function () {    
                                                    Ext.Array.erase(this.keyNav.map.bindings, 0, 1);        
                                                });" Delay="1" />
            </Listeners>
    After many tests I found that it works only if at least one column has the Flex attribute set. (???) Why??
    Can you explain me why ? I wouldn't want to set one column flex because the fields are few and the flex field will fill the whole remaining space appearing ugly to handle, overall if it is a combo.

    try to test it in explorer 10, defining aand then exlcuding the Flex property on the column Email and you get the error
    Error: Unable to get property 'on' of undefined or null reference

    it doesn't recognize the editorplugin (not yet instantited..)

    thanks in advance

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.ObjectModel" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ 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 List<object>
                {
                    new { 
                        Name = "Bill Foot", 
                        Email = "bill.foot@object.net"
                    },
                    new { 
                        Name = "Bill Little", 
                        Email = "bill.little@object.net"
                    }
                };
    
                store.DataBind();
            }
        }
    </script>
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
        <title>GridPanel with RowEditor Plugin - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    </head>
    <body>
        <form id="Form1" runat="server">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Store ID="Store1" runat="server">
            <Model>
                <ext:Model ID="Model1" runat="server" Name="Employee" IDProperty="name">
                    <Fields>
                        <ext:ModelField Name="name" ServerMapping="Name" Type="String" />
                        <ext:ModelField Name="email" ServerMapping="Email" Type="String" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
        <ext:GridPanel ID="GridPanel1" StoreID="Store1" runat="server" Width="600" Height="400"
            Frame="true" Title="Employees">
            <Plugins>
                <ext:RowEditing ID="RowEditing1" runat="server" ClicksToMoveEditor="1"
                    AutoCancel="false" />
            </Plugins>
            <ColumnModel>
                <Columns>
                    <ext:Column ID="Column3" runat="server" Text="User" DataIndex="name" Width="150" >
                        <Editor>
                            <ext:TextField ID="TextField1" ItemID="name" runat="server">
                            </ext:TextField>
                        </Editor>
                    </ext:Column>
                    <ext:Column ID="Column4" runat="server" Text="Email" Flex="1" DataIndex="email">
                        <Editor>
                            <ext:TextField ID="TextField2" runat="server" />
                        </Editor>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <Listeners>
                <AfterRender Handler="this.editingPlugin.editor.on('afterrender', function () {    
                                                    Ext.Array.erase(this.keyNav.map.bindings, 0, 1);        
                                                });" Delay="1" />
            </Listeners>
        </ext:GridPanel>
        </form>
    </body>
    </html>
    Last edited by Daniil; Jun 23, 2013 at 3:35 PM. Reason: [CLOSED]
  2. #2
    Hi @tanky65,

    Please use:
    <AfterRender Handler="this.editingPlugin.getEditor().on('afterrender', function () {    
                                        Ext.Array.erase(this.keyNav.map.bindings, 0, 1);        
                                    });" Delay="1" />
  3. #3
    I confirm that it works, thanks
  4. #4
    Thanks! work for me too.

Similar Threads

  1. Replies: 6
    Last Post: Jun 21, 2013, 3:59 PM
  2. [CLOSED] How to disable component column editor
    By bayoglu in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 19, 2013, 7:16 PM
  3. Replies: 1
    Last Post: Aug 29, 2012, 12:32 PM
  4. How to disable column of EditableGrid Plugin
    By abhijit in forum 1.x Help
    Replies: 2
    Last Post: Mar 06, 2012, 4:26 AM
  5. Replies: 2
    Last Post: Nov 26, 2010, 6:30 PM

Posting Permissions