[OPEN] [#1575] BeforeComplete... return false issue

  1. #1

    [OPEN] [#1575] BeforeComplete... return false issue

    Support,

    See attached example. Simply change the combo to any other value and click off it. The Editable combo is still there. i utilized a "return false" on the BeforeComplete handler to cancel the change. However, the combo isnt hidden and the field returned to normal.

    Please assist asap. We were supposed to deploy this update this evening.

    thanks,
    /Z

    <%@ Page Language="C#" %>
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Stt.DataSource = new object[]
                {
                    new object[] {  0.01, ".01"},
                    new object[] {  0.02, ".02"},
                    new object[] {  0.03, ".03"},
                    new object[] {  0.04, ".04"},
                    new object[] {  0.05, ".05"},
                    new object[] {  0.06, ".06"}
                };
    
    
                Stt.DataBind();
                
                this.GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { "[9/1/2017 2:00a] 3m777", "[9/1/2017 2:00] 3m",71.72, 0.02, 0.03, new DateTime(2017, 9, 1, 2, 0, 0) },
                    new object[] { "[9/1/2017 2:00a]666 3m", "[9/1/2017 2:00] 3m",71.72, 0.02, 0.03, new DateTime(2017, 9, 1, 2, 0, 0) },
                    new object[] { "[9/1/2017 2:05550a] 3m", "[9/1/2017 2:00] 3m",71.72, 0.02, 0.03, new DateTime(2017, 9, 1, 2, 0, 0) },
                    new object[] { "[9/1/2017 4442:00a] 3m", "[9/1/2017 2:00] 3m",71.72, 0.02, 0.03, new DateTime(2017, 9, 1, 2, 0, 0) }
                };
    
    
                this.GridPanel1.Store.Primary.DataBind();
            }
        }
    </script>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head id="Head2" runat="server">
        <title>GridPanel with Locking Columns - Ext.NET Examples</title>
    
    
        <script>
    
    
            var StoreIdRenderer = function (value, metaData, record, rowIndex, colIndex, store) {
    
    
                return value;
    
    
    
    
            };
        </script>
    </head>
    <body>
    
    
            <ext:Store ID="Stt" runat="server" AutoLoad="true">
                <Model>
                    <ext:Model ID="Model1" IDProperty="id" runat="server">
                        <Fields>
                            <ext:ModelField Name="id" />
                            <ext:ModelField Name="description" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
    
    
    
    
        <ext:ResourceManager ID="ResourceManager2" runat="server" Theme="NeptuneTouch" />
    
    
            <ext:Viewport ID="Viewport1" runat="server" Layout="VBoxLayout">          
                <LayoutConfig>
                    <ext:VBoxLayoutConfig Align="Stretch" />
                </LayoutConfig>
                <Items>
    
    
    
    
                    <ext:GridPanel
                        ID="GridPanel1"
                            runat="server"
                            TitleCollapse="true"
                            ColumnLines="true"
                            Flex="1">
                        <Store>
                            <ext:Store ID="Store2" runat="server" PageSize="3000">
                                <Model>
                                    <ext:Model ID="Model2" runat="server">
                                        <Fields>
                                            <ext:ModelField Name="company" />
                                            <ext:ModelField Name="companySort" />
                                            <ext:ModelField Name="price" Type="Float" />
                                            <ext:ModelField Name="change" Type="Float" />
                                            <ext:ModelField Name="pctChange" Type="Float" />
                                            <ext:ModelField Name="lastChange" Type="Date" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                                <Grouper Property="company" SortProperty="company" Direction="ASC" />
                                <Sorters>
                                    <ext:DataSorter Property="lastChange" Direction="DESC" />
                                </Sorters>
                            </ext:Store>
                        </Store>
                        <Plugins>
                            <ext:CellEditing ID="CellEditing1" ClicksToEdit="1" runat="server">
                            </ext:CellEditing>
                        </Plugins>
                        <View>
                            <ext:GridView ID="GridView1" runat="server">
                            </ext:GridView>
                        </View>
    
    
                        <ColumnModel>
                            <Columns>
                                <ext:Column runat="server" Align="Center" Text="test" CellWrap="true" Width="200" DataIndex="change">
                                    <Renderer Handler="StoreIdRenderer" />
                                    <Editor>
                                        <ext:ComboBox runat="server"
                                            ID="test1"
                                            ValueField="id"
                                            DisplayField="description"
                                            QueryMode="Local"
                                            StoreID="Stt">
                                            <ListConfig MaxWidth="200" MinWidth="90" />
                                        </ext:ComboBox>
                                    </Editor>
                                    <EditorOptions>
                                        <Listeners>
                                            <BeforeComplete Handler="return false;" />
                                        </Listeners>
                                    </EditorOptions>
                                </ext:Column>
                             </Columns>
                        </ColumnModel>
                    </ext:GridPanel>
                    </Items>
                </ext:Viewport>
    </body>
    </html>
    Last edited by fabricio.murta; Feb 21, 2018 at 10:12 PM.
  2. #2
    so i modified the listener... and now it works!
    Please file a defect for this. it should run cancelEdit automatically.
    /Z

    <Listeners>                                        
    <BeforeComplete Handler="this.cancelEdit(false); return false;" />                                   
    </Listeners>
  3. #3
    Hello @Z!

    Thanks for reporting the issue!

    By reading the BeforeComplete event documentation in Sencha docs, I'm still not really sure it is expected to do the cancel edit if it returns false. It does say it avoids saving the change but says nothing about cancelling/dismissing the editor when returning false. Maybe if they did so with BeforeComplete returning false, it will result in undesirable side effects in some situations... or this was simply not thought thru.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Hello again!

    Anyway, we've logged it as a feature (keeping in mind the possibility to assume this is a bug also) under #1575.

    We'll post another update here as soon as the issue is fixed or feature implemented.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 24
    Last Post: Dec 19, 2015, 11:01 AM
  2. Replies: 2
    Last Post: Aug 21, 2015, 12:38 PM
  3. [CLOSED] Checkbox return true/false
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 04, 2011, 5:42 AM
  4. radio button always return false
    By hector_toy82 in forum 1.x Help
    Replies: 0
    Last Post: Nov 17, 2010, 7:11 PM
  5. Replies: 2
    Last Post: Nov 11, 2008, 1:47 PM

Posting Permissions