GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

Client events not firing in Firefox

Last post 02-08-2010, 3:24 PM by Rakesh_P. 5 replies.
Sort Posts: Previous Next
  •  02-04-2010, 6:38 PM 87104

    Client events not firing in Firefox

    Hi!!

    I have four levels of cascaded dropdowns in my spread. Each dropdown cell is a custom cell and is built using the following code.

    <Serializable()> Public Class ComboBoxAPCellType

    Inherits FarPoint.Web.Spread.ComboBoxCellType

    Public Overrides Function GetEditorControl(ByVal id As String, ByVal parent As System.Web.UI.WebControls.TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal value As Object, ByVal upperLevel As Boolean) As System.Web.UI.Control

    Dim c As DropDownList = CType(MyBase.GetEditorControl(id, parent, style, margin, value, upperLevel), DropDownList)

    Dim ssID As String = GetSpreadId(parent)

    c.Attributes.Add("onChange", "var ss=" & ssID & ";ss.EndEdit();ss.UpdatePostbackData();ss.CallBack('updCombo');")

    Return c

    End Function

    Private Function GetSpreadId(ByVal parent As Control) As String

    Dim c As Control = parent.Parent

    Do While parent IsNot Nothing

    If TypeOf c Is FarPoint.Web.Spread.FpSpread Then

    Return DirectCast(c, FarPoint.Web.Spread.FpSpread).ClientID

    End If

    c = c.Parent

    Loop

    Return ""

    End Function

    End Class 

    The problem is in Firefox its not firing these event UpdatePostbackData();ss.CallBack and therefore cascading it doesn't work in firefox. I am using Spread's AJAX feature by turning on the property EnableAjaxCall="true" My spread version is 4.0.2006.2008

    Please advise how to fix this problem in Firefox. Everything works fine in IE 7.0

    Thanks,

    Rakesh

     

     

     

     

     

  •  02-05-2010, 6:54 AM 87109 in reply to 87104

    Re: Client events not firing in Firefox

    Hello,

    Client side event handling is a bit different in Firefox.You need to first check for the browser in order to implement the client side code. This is what I came across in Spread documentation:

    You need to use Firefox's way to attach events. For example

    <HEAD>

    ...

    <script language=javascript>

    function init() {

    var ss = document.getElementById("FpSpread1");

    if (document.all) {

    // IE

    ss.onDataChanged = test;

    }

    else

    {

    // Firefox

    alert("init firefox");

    ss.addEventListener("DataChanged", test, false);

    }

    }

     

    function test() {

    alert("data changed");

    }

    </script>

    </HEAD>

    <body MS_POSITIONING="GridLayout" onload="init()">

    FireFox does not support JavaScript properties as IE does; everything is accessed with methods. For example, to get the active row and active column, you use the GetActiveRow method and the GetActiveCol method respectively. In code,

          var row = ss.GetActiveRow();

          alert(row); 

     

    Thanks,

     

     


    Deepak Sharma
    GrapeCity FarPoint
  •  02-05-2010, 1:33 PM 87114 in reply to 87109

    Re: Client events not firing in Firefox

    Hi!!

    With respect to my code can you tell me how will I write it for Firefox. I have to fire these events on "onChange" event of my custom dropdowncell. The events are

    ss.EndEdit;

    ss.UpdatePostbackData;

    ss.CallBack('updCombo');

    Please tell me how to accomplish this using addEventListener method.

    Thanks,

    Rakesh 

     

     

     

  •  02-08-2010, 11:23 AM 87148 in reply to 87114

    Re: Client events not firing in Firefox

    Hi Deepak!!

    Can you please help me out with my above question.

    Thanks,

    Rakesh 

     

     

     

  •  02-08-2010, 1:51 PM 87152 in reply to 87148

    Re: Client events not firing in Firefox

    Rakesh,

    We got the following information from concerned team on the reported issue:

    In the project they sent to us, they were pretty close. They had to make sure the string they passed in for the id was surounded by quotes.

                c.Attributes.Add("onChange", "myFunction('" & ssID & "')")

    Then, client side, they needed to change their function header to have the variable for the name of the Spread.
     function myFunction(ssID)
    {
            var ss= document.getElementById(ssID);  //How to get FpSpread1 id dynamically
     
    }

    Suresh Singh Dasila
    GrapeCity FarPoint
  •  02-08-2010, 3:24 PM 87158 in reply to 87152

    Re: Client events not firing in Firefox

    Thank you so much Suresh!! It works.

    Thanks,

    Rakesh 

     

     

View as RSS news feed in XML
     FarPoint Forums Home