[CLOSED] EditorOptions

  1. #1

    [CLOSED] EditorOptions

    In a grid, I'm trying to add editor options to a column...specifically, I want to modify some values on BeforeStartEdit of a control. However, I can't get the function/handler to ever fire. Am I missing something?

    
    <Editor>                                
    <ext:MultiCombo runat="server" ID="Flags" StoreID="SelectedFlagTypeStore" DisplayField="TypeName" ValueField="TypeID" ForceSelection="true" SelectionMode="All"></ext:MultiCombo>                            
    </Editor>                            
    <EditorOptions>                                
    <Listeners>                                    
    <BeforeStartEdit Handler="alert('hi');" />                                    
    <BeforeComplete Fn="stuff" />                                
    </Listeners>                            
    </EditorOptions>
    Last edited by Daniil; May 23, 2012 at 8:37 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I have all events to be fired.

    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" },
                    new object[] { "test2" },
                    new object[] { "test3" }
                };
                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 v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <Store>
                <ext:Store runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="test1" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Test1" DataIndex="test1">
                        <Editor>
                            <ext:MultiCombo runat="server">
                                <Items>
                                    <ext:ListItem Text="Item 1" />
                                    <ext:ListItem Text="Item 2" />
                                </Items>
                            </ext:MultiCombo>
                        </Editor>
                        <EditorOptions>
                            <Listeners>
                                <BeforeStartEdit Handler="console.log('BeforeStartEdit');" />
                                <StartEdit Handler="console.log('StartEdit');" />
                                <CancelEdit Handler="console.log('CancelEdit');" />
                                <BeforeComplete Handler="console.log('BeforeComplete');" />
                                <Complete Handler="console.log('Complete');" />
                            </Listeners>
                        </EditorOptions>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <Plugins>
                <ext:CellEditing runat="server" />
            </Plugins>
        </ext:GridPanel>
    </body>
    </html>
    If the issue persists, please update form SVN and re-test.
    http://svn.ext.net/premium/branches/2.0
    Last edited by Daniil; May 17, 2012 at 6:56 PM.
  3. #3
    Many thanks...that helps. One more question then, I can get BeforeStartEdit to fire with CellEditing...does it work with RowEditing? I wasn't aware there might be a distinction for this event. I'm currently using a RowEditing plugin and BeforeStartEdit doesn't appear to fire when I apply EditorOptions to a specific column

    Any assistance you can provide would be greatly appreciated. Many thanks!

    Quote Originally Posted by Daniil View Post
    Hi,

    I have all events to be fired.

    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" },
                    new object[] { "test2" },
                    new object[] { "test3" }
                };
                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 v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <Store>
                <ext:Store runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="test1" />
                                <ext:ModelField Name="test2" />
                                <ext:ModelField Name="test3" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Test1" DataIndex="test1">
                        <Editor>
                            <ext:MultiCombo runat="server">
                                <Items>
                                    <ext:ListItem Text="Item 1" />
                                    <ext:ListItem Text="Item 2" />
                                </Items>
                            </ext:MultiCombo>
                        </Editor>
                        <EditorOptions>
                            <Listeners>
                                <BeforeStartEdit Handler="console.log('BeforeStartEdit');" />
                                <StartEdit Handler="console.log('StartEdit');" />
                                <CancelEdit Handler="console.log('CancelEdit');" />
                                <BeforeComplete Handler="console.log('BeforeComplete');" />
                                <Complete Handler="console.log('Complete');" />
                            </Listeners>
                        </EditorOptions>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <Plugins>
                <ext:CellEditing runat="server" />
            </Plugins>
        </ext:GridPanel>
    </body>
    </html>
    If the issue persists, please update form SVN and re-test.
    http://svn.ext.net/premium/branches/2.0
  4. #4
    In the case with RowEditing you should use the RowEditing events: BeforeEdit, Edit, CancelEdit, ValidateEdit.

Posting Permissions