[CLOSED] Problem with Firefox and Chrome

  1. #1

    [CLOSED] Problem with Firefox and Chrome

    Hello,

    in my MVC application I have the following page:

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!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 id="Head1" runat="server">
            <title></title>
            
            <ext:ResourcePlaceHolder ID="MainResourcePlaceHolder" runat="server" />
    
            <script type="text/javascript">
    
                var onGridCommand = function (command, record, rowIndex, colIndex) {
                    Ext.net.DirectMethod.request({
                        url: "/EasyRapp/Support/UploadFileList",
                        cleanRequest: true
                    });
                };
            </script>
            
        </head>
        <body>
            <ext:ResourceManager ID="MainScriptManager" runat="server" DisableViewState="true"/>
           
            <ext:Store ID="dsEmployees" runat="server" RemoteSort="true">
                <Proxy>
                    <ext:HttpProxy Url="~/Support/GetEmployeeList/" />
                </Proxy>
                <Reader>
                    <ext:JsonReader IDProperty="EmployeeId" Root="data" TotalProperty="total">
                        <Fields>
                            <ext:RecordField Name="EmployeeId" Type="Int"/>
                            <ext:RecordField Name="EmployeeCode" />
                            <ext:RecordField Name="FirstName" />
                            <ext:RecordField Name="LastName" SortDir="ASC" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <SortInfo Field="LastName" Direction="ASC" />
    
            </ext:Store>
           
            <ext:Viewport ID="MainViewport" runat="server" Layout="BorderLayout">
                <Items>
                    <ext:GridPanel
                        ID="MainGridPanel"
                        runat="server" 
                        Region="Center"
                        Layout="FitLayout"
                        Border="false"
                        TrackMouseOver="true"
                        StoreID="dsEmployees"
                        StripeRows="true">
                        
                        <ColumnModel ID="MainColumnModel" runat="server">
                            <Columns>
                                <ext:ImageCommandColumn Width="46" Resizable="false">
                                    <Commands>
                                        <ext:ImageCommand CommandName="Attachment" Icon="Attach" />
                                    </Commands>
                                </ext:ImageCommandColumn>
                                <ext:Column ColumnID="EmployeeId" DataIndex="EmployeeId" Header="ID"  Hidden="true" />
                                <ext:Column ColumnID="EmployeeCode" DataIndex="EmployeeCode" Header="Codice" />
                                <ext:Column ColumnID="LastName" DataIndex="LastName" Header="LastName" />
                                <ext:Column ColumnID="FirstName" DataIndex="FirstName" Header="FirstName" />
                            </Columns>
                        </ColumnModel>
                        
                        <Listeners>
                            <Command Fn="onGridCommand" />
                        </Listeners>
                        
                        <SelectionModel>
                            <ext:RowSelectionModel ID="MainRowSelectionModel" runat="server" />
                        </SelectionModel>
                       
                    </ext:GridPanel>
                </Items>
            </ext:Viewport>
    
        </body>
    </html>
    When you click the Attachment ImageCommand the following .ascx is rendered:

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script type="text/javascript">
        var YContext = {
            HelloText: "Hello from YContext"
        };
    </script>
    
    <ext:Window
        ID="UPLListWindow" 
        Modal="true"
        runat="server" 
        Title="Allegati" 
        Icon="Attach" 
        Width="800"    
        Height="400" 
        MinWidth="320"
        MinHeight="200" 
        Layout="FitLayout"
        CloseAction="Close"
        Closable="true">
        <Items>
            <ext:FormPanel
                ID="UPLMainFormPanel"
                runat="server"
                Border="false"
                Layout="FitLayout">
                <Items>
                    <ext:GridPanel
                        ID="YMainGridPanel" 
                        runat="server" 
                        Header="false"
                        Border="false"
                        TrackMouseOver="true"
                        AutoExpandColumn="AttachmentName"
                        StripeRows="true">
                        <Store>
                            <ext:Store ID="dsAttachments" runat="server" AutoLoad="true">
                                <Proxy>
                                    <ext:HttpProxy Url="/EasyRapp/Support/GetAttachmentList/" />
                                </Proxy>
                                <Reader>
                                    <ext:JsonReader IDProperty="AttachmentId" Root="data">
                                        <Fields>
                                            <ext:RecordField Name="AttachmentId" Type="Int" />
                                            <ext:RecordField Name="AttachmentName" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                                <SortInfo Field="AttachmentName" Direction="ASC" />
    
                            </ext:Store>
                        </Store>
                        
                        <ColumnModel ID="UPLColumnModel" runat="server">
                            <Columns>
                                <ext:Column ColumnID="AttachmentId" DataIndex="AttachmentId" Header="ID"  Width="75" Hidden="true"/>
                                <ext:Column ColumnID="AttachmentName" DataIndex="AttachmentName" Header="Title" />
                            </Columns>
                        </ColumnModel>
    
                        <TopBar>
                            <ext:Toolbar ID="UPLTopToolbar" runat="server" EnableOverflow="false">
                                <Items>
                                    <ext:Button 
                                        ID="UPLButtonUpload"
                                        runat="server" 
                                        Text=" Upload" 
                                        Icon="DiskUpload">
                                        <Listeners>
                                            <Click Handler="alert(YContext.HelloText);" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                    </ext:GridPanel>
                </Items>
    
            </ext:FormPanel>
    
        </Items>
    </ext:Window>
    This is the controller code:

    ....
        private class MyEmployee
        {
            public int EmployeeId;
            public string EmployeeCode;
            public string FirstName;
            public string LastName;
        }
    
        private class MyAttachment
        {
            public int AttachmentId;
            public string AttachmentName;
        }
    
        public ActionResult EmployeeList()
        {
            return View();
        }
    
        public AjaxStoreResult GetEmployeeList()
        {
            List<MyEmployee> list = new List<MyEmployee>();
            list.Add(new MyEmployee { EmployeeId = 1, EmployeeCode = "0001", FirstName = "FirstName1", LastName = "LastName1" });
            list.Add(new MyEmployee { EmployeeId = 2, EmployeeCode = "0002", FirstName = "FirstName2", LastName = "LastName2" });
            list.Add(new MyEmployee { EmployeeId = 3, EmployeeCode = "0003", FirstName = "FirstName3", LastName = "LastName3" });
            list.Add(new MyEmployee { EmployeeId = 4, EmployeeCode = "0004", FirstName = "FirstName4", LastName = "LastName4" });
            list.Add(new MyEmployee { EmployeeId = 5, EmployeeCode = "0005", FirstName = "FirstName5", LastName = "LastName5" });
    
            return new AjaxStoreResult(list, 5);
        }
    
        public Ext.Net.MVC.PartialViewResult UploadFileList()
        {
            Ext.Net.MVC.PartialViewResult pvr = new Ext.Net.MVC.PartialViewResult();
            return pvr;
        }
    
        public AjaxStoreResult GetAttachmentList()
        {
            List<MyAttachment> list = new List<MyAttachment>();
            list.Add(new MyAttachment { AttachmentId = 1, AttachmentName = "Attachment1" });
            list.Add(new MyAttachment { AttachmentId = 2, AttachmentName = "Attachment2" });
            list.Add(new MyAttachment { AttachmentId = 3, AttachmentName = "Attachment3" });
    
            return new AjaxStoreResult(list, 3);
        }
    .....
    Now, if you click the UPLButtonUpload toolbar button you should see an Hello alert message.
    This message is properly displayed in IE9 but nothing happens with Firefox (I'm using 8.0.1) and Chrome (15.0.874.121).

    Bye,
    Stefano
    Last edited by Daniil; Dec 07, 2011 at 12:44 PM. Reason: [CLOSED]
  2. #2
    Hi Stefano,

    Your code works for me in the same way in all IE, FF and Chrome - I see an alert box with the "Hello from the YContext" message.

    And I can't see why it might not work on your side.

    Please clarify do you have any JS errors in FF and Chrome when click on the button?
  3. #3
    Hi Daniil,

    When I click the button, simply nothing happens and no message is displayed.

    Where can I investigate? I can tell you that I have encountered the same problem also with Opera.

    Bye,
    Stefano
  4. #4
    In FireFox you can use the FireBug plugin, in Chrome - its developer tools.
  5. #5
    Hi,

    I updated from SVN and now all works fine on all browsers.

    My previous update was done on 2011-05-16.

    Bye,
    Stefano
  6. #6
    Can we mark the thread as closed?
  7. #7
    Yes.

    Bye,
    Stefano

Similar Threads

  1. [CLOSED] Display problems on Chrome and Firefox
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 18, 2011, 6:18 AM
  2. Problem with a example in Chrome and Firefox...
    By Tanielian in forum 1.x Help
    Replies: 2
    Last Post: Apr 07, 2011, 6:14 PM
  3. Replies: 4
    Last Post: Nov 22, 2010, 10:25 AM
  4. [CLOSED] Problem with gridpanel column resizing in firefox and chrome
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 25
    Last Post: Sep 14, 2010, 2:10 PM
  5. Replies: 2
    Last Post: Feb 05, 2010, 5:20 PM

Posting Permissions