RadAjaxPanel multiple ClientEvents

3 posts, 1 answers
  1. Ando
    Ando avatar
    7 posts
    Member since:
    Jul 2010

    Posted 27 Jul 2010 Link to this post

    I have a few questions about the RadAjax Panel, as I am new to my company and Telerik products.

    In the declaration of a RadAjaxPanel, the "ClientEvents-OnResponseEnd" attribute makes a call to 2 JavaScript methods, shown here:

    <telerik:RadAjaxPanel Width="100%" ID="resultsUpdatePanel" runat="server" ClientEvents-OnResponseEnd="resizeGrid(true);calcResultsLoad();"
                LoadingPanelID="RadAjaxLoadingPanel">
                <div id="divResultsGrid" runat="server" style="margin-left: 10px;">
                    <eACoolGrid:CoolGridView ID="grdResults" runat="server" GridLines="None" AutoGenerateColumns="true"
                        AllowPaging="false" ShowFooter="false" EnableViewState="true" AllowSorting="true"
                        EmptyDataText="No Data to Display" DefaultColumnWidth="75px" Width="99%">
                    </eACoolGrid:CoolGridView>
                </div>
            </telerik:RadAjaxPanel>

    The grid inside is an IdeaSparx CoolGrid. I am trying to troubleshoot a bug, but because there are several layers to this, I am trying to narrow down where the problem lies.

    For now, I would like to know the following 2 things:
    1. Does the ClientEvents attribute support executing multiple JavaScript method calls like this (example in documentation only showed one)?
    2. Does the content of the ClientEvents attribute get called only upon the first load of the control, or every time a callback causes the panel to update?

    Depending on the answers, this may lead to other follow-up questions.

    Thanks in advance for any help!

    Ando Poore
  2. Answer
    Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 27 Jul 2010 Link to this post

    Hello Ando,

    1. No, the ClientEvents-OnResponseEnd does not accept mulitple methods to be passed to it like you are doing. You need to create a method that follows the OnResponseEnd method signature and set the method name in that property. To call two methods at once you could write it like so:

    function responseEnd(sender, eventArgs)
    {
       resizeGrid(true);
       calculateResultsLoad();
    }

    And pass it to the RadAjaxPanel like so: ClientEvents-OnResponseEnd="responseEnd".

    2. It would get called on every ajax request.

    I hope that helps.
  3. Ando
    Ando avatar
    7 posts
    Member since:
    Jul 2010

    Posted 27 Jul 2010 Link to this post

    That did help, thanks!
Back to Top