[CLOSED] NumberField: track dblClick event

  1. #1

    [CLOSED] NumberField: track dblClick event

    Hello,

    I define a GridPanel with the cellSelectionModel as follow

    gridPanel.SelectionModel.Add(new CellSelectionModel() { ID = "cellSelectionModel"});
    gridPanel.Listeners.CellDblClick.Fn = "CellDblClickHandler";
    The gridPanel has many columns. Some of them is of type numberField. Ths issue occurs with these columns. The CellDblClickHandler function is not called when I click on a column with type numberField. For all others columns it is called.

    How can I work arround this issue? Any idea?

    Romuald.
    Last edited by geoffrey.mcgill; Sep 17, 2010 at 5:18 PM. Reason: [CLOSED]
  2. #2
    Hello!

    Some of them is of type numberField.
    Please clarify do you mean <ext:NumberColumn> ?
  3. #3
    The column are defined a s follow

     
    Column column = new Column();
    column.Sortable = true;
    column.ColumnID = "id";
    column.DataIndex = "Day";
    column.Header = day;
    column.Renderer.Fn = "formatNullOr4Decimal";
    column.Editor.Add(new NumberField() { SelectOnFocus = true, DecimalPrecision = 4 });
    column.Align = Alignment.Right;
    Romuald.
  4. #4
    I'm tried to reproduce the issue but I can't.

    Here is my sample code. It works fine. Please try it.
    If it won't work on your side please update from the SVN and retest.
    If it will work please provide us with your sample code which we can run without any change.

    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.Store.Primary;
                store.DataSource = new object[] { 
                                             new object[] {"test11", "test12", 1},
                                             new object[] {"test21", "test22", 2},
                                             new object[] {"test31", "test32", 3}
                                    };
                store.DataBind();
    
                GridPanel1.SelectionModel.Add(new CellSelectionModel());
    
                Column column = new Column();
                column.Sortable = true;
                column.ColumnID = "id";
                column.DataIndex = "test3";
                column.Header = "NumberField";
                column.Renderer.Fn = "formatNullOr4Decimal";
                column.Editor.Add(new NumberField() { SelectOnFocus = true, DecimalPrecision = 4 });
                column.Align = Alignment.Right;
    
                GridPanel1.ColumnModel.Columns.Add(column);
    
                GridPanel1.Listeners.CellDblClick.Handler = "alert('CellDblClick')";
    
            }
        }
    </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 formatNullOr4Decimal = function(value) {
                return value;
            }
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <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" />
                    <ext:Column Header="Test2" DataIndex="test2" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  5. #5
    Hello,

    Thank for your reply. It works in your case.

    In the definition of my grid I have the option ClickToEdit set to 1

    something like this

    <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" ClicksToEdit="1">
    With this option it doesn't work any more.

    Have you another idea?

    Romuald.
  6. #6
    Yes, this property causes this behavior.
    When it's set to 1 the CellDblClick can't be fired because of the CellClick event is handled before.

    So, please provide with details what exactly behavior do you want when clicking on cell of this column and we'll try to suggest you a solution.
  7. #7
    Thanks,

    I will try something else. If it works i will abandon the current idea. If not I will explain you what I really want to do.

    Romuald.

Similar Threads

  1. Track form changes
    By xMAC in forum 1.x Help
    Replies: 10
    Last Post: Feb 28, 2011, 2:04 PM
  2. [CLOSED] NumberField paste event
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 12, 2010, 7:52 AM
  3. [CLOSED] Get Old Value for Numberfield Blur Event
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 16, 2010, 9:09 AM
  4. [CLOSED] Tree doubleclick (dblclick) event does not fire
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 01, 2010, 4:56 PM
  5. Replies: 2
    Last Post: Jun 01, 2009, 10:45 AM

Posting Permissions