This is a migrated thread and some comments may be shown as answers.

RadAjaxPanel multiple ClientEvents

2 Answers 88 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ando
Top achievements
Rank 1
Ando asked on 27 Jul 2010, 02:41 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 27 Jul 2010, 03:36 PM
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.
0
Ando
Top achievements
Rank 1
answered on 27 Jul 2010, 04:37 PM
That did help, thanks!
Tags
Ajax
Asked by
Ando
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Ando
Top achievements
Rank 1
Share this question
or