[CLOSED] Edit record on IE

  1. #1

    [CLOSED] Edit record on IE

    On the following example, clicking on Clear Age Of First Record button clears the age of the first record.

    On IE it shows null


    On Chrome it works as expected.


    On FireFox it works as expected.


    <!DOCTYPE html>
    <html>
    <head runat="server">
        <script type="text/javascript">
            var ClearAgeOfFirstRecord = function () {
                var recordFromStore = App._str.data.map[1];
    
                recordFromStore.beginEdit();
    
                recordFromStore.data.Age = null;
    
                recordFromStore.endEdit();
    
                recordFromStore.commit();
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:GridPanel Title="Ext.Net" Border="true" Width="500" Height="400" runat="server">
            <Store>
                <ext:Store ID="_str" AutoLoad="true" runat="server">
                    <Proxy>
                        <ext:AjaxProxy Url="~/Example/LoadFakeRecords/">
                            <ActionMethods Read="POST" />
                            <Reader>
                                <ext:JsonReader RootProperty="data" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model IDProperty="ID" runat="server">
                            <Fields>
                                <ext:ModelField Name="ID" Type="String" />
                                <ext:ModelField Name="Name" Type="String" />
                                <ext:ModelField Name="Age" AllowNull="true" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Text="ID" DataIndex="ID" runat="server" />
                    <ext:Column Text="Name" Flex="1" DataIndex="Name" runat="server" />
                    <ext:Column Text="Age" DataIndex="Age" runat="server" />
                </Columns>
            </ColumnModel>
            <Buttons>
                <ext:Button Text="Clear Age Of First Record" runat="server">
                    <Listeners>
                        <Click Handler="ClearAgeOfFirstRecord();" />
                    </Listeners>
                </ext:Button>
            </Buttons>
        </ext:GridPanel>
    </body>
    </html>
    namespace SandBox.Controllers
    {
        public class ExampleController : System.Web.Mvc.Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public StoreResult LoadFakeRecords()
            {
                List<Entity> lst = new List<Entity>();
    
                for (int index = 1; index < 16; index++)
                {
                    lst.Add(new Entity
                    {
                        ID = index,
                        Name = string.Format("Name - {0}", index),
                        Age = index
                    });
                }
    
                return new StoreResult(lst, lst.Count());
            }
        }
    
        [Serializable]
        public class Entity
        {
            public int ID { get; set; }
    
            public string Name { get; set; }
    
            public Nullable<int> Age { get; set; }
        }
    }
    Attached Thumbnails Click image for larger version. 

Name:	er001.png 
Views:	11 
Size:	7.5 KB 
ID:	20561   Click image for larger version. 

Name:	er002.png 
Views:	9 
Size:	10.4 KB 
ID:	20571   Click image for larger version. 

Name:	er003.png 
Views:	7 
Size:	8.6 KB 
ID:	20581  
    Last edited by Daniil; Feb 17, 2015 at 12:55 PM. Reason: [CLOSED]
  2. #2
    Hi Raphael,

    An interesting issue. This example demonstrates what happens internally.

    Example
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v3 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Button runat="server" Text="Test" Handler="div1.innerHTML = null;" />
    
            <p>Test div:</p>
            <div id="div1"></div>
        </form>
    </body>
    </html>
    It behaves the same. IE - "null" appears, Firefox and Chrome - nothing appears.

    As a workaround I can suggest to use this Renderer for a Column:
    <Renderer Handler="return value;" />
    Using a Renderer changes the rendering process a little bit and there is no a direct set of innerHTML.
  3. #3
    Thank you Daniil. I will review.

Similar Threads

  1. Grid record not loading in form for edit
    By jbarbeau in forum 2.x Help
    Replies: 1
    Last Post: Aug 25, 2014, 10:24 PM
  2. Edit store record when user clicks on the row
    By Mr.Techno in forum 1.x Help
    Replies: 6
    Last Post: Aug 29, 2011, 1:40 PM
  3. Add Record to GridPanel but NOT Edit Existing Records
    By mkshields9w57 in forum 1.x Help
    Replies: 0
    Last Post: Aug 11, 2011, 12:45 PM
  4. [CLOSED] I can not edit inserted record in a grid.
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 03, 2010, 8:20 PM
  5. [CLOSED] Edit current record in a Column-Editor.
    By macap in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 04, 2009, 3:57 PM

Posting Permissions