Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3475
JavaScript not accepting parameters in 8.2
posted

We just updated our system to use Visual Studio 2008 and Infragistic NetAdvantage 8.2.  Clientsideevents that use to work are now causing us problems.  We have some cases where we are using clientsideevents on grids and passing parameters to the JS function.  We are getting errors that it can’t find the method.  It appears the events only want you to pass the name of the method, not any parameters. 

For example, several other pages are using common functions in a common js file to handle checking and unchecking checkboxes for expandable bands and making sure the ExpandAll checkbox is checked/unchecked in synch.  We are setting an event handler like this: ugrdCreditScores.DisplayLayout.ClientSideEvents.AfterRowCollapsedHandler = "infragGridAfterRowCollapsed('" & ugrdCreditScores.ClientID & "', '" & chkExpandAll.ClientID & "')"

When this line is changed to the following it will not get the error but it does not do what was requested.  Is there a work around for this?

ugrdCreditScores.DisplayLayout.ClientSideEvents.AfterRowCollapsedHandler = "infragGridAfterRowCollapsed"                                            

Parents
  • 28464
    posted

    Hello,

    The syntax for client-side events in recent version of UltraWebGrid is fixed - the name of the event handler and fixed parameters that are documented in the Client Side Event CSOM here

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_Client_Side_Events_CSOM.html

    for example, the syntax for AfterRowCollapsed is:

    AfterRowCollapsed

    Fired after a row is collapsed on the client
    Parameters
    gridName

    String. The name of the Grid which is firing this event.
    rowId

    String. The id of the row which was activated.

    which translates in the following event handler:

    function infragGridAfterRowCollapsed(gridID, rowID)

    {

    ...

    }

    unfortunately you cannot pass additional parameters directly from the server anymore, but you can use client-side code for that. For example:

    function infragGridAfterRowCollapsed(gridID, rowID)
    {
        ...
        var gridID = "<%= ugrdCreditScores.ClientID %>";
        var chckExpandAllID = "<%= chkExpandAll.ClientID %>";
        ...

Reply Children