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

[Solved] What does this do?

1 Answer 170 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Angela
Top achievements
Rank 1
Angela asked on 09 Apr 2008, 01:45 AM

ScriptManager

.RegisterStartupScript(
rdTemp,
this.GetType(),
"AddDock",
tring.Format(@"function _addDock() {{" +
"Sys.Application.remove_load(_addDock);" +
"$find('{1}').dock($find('{0}'));" +
"$find('{0}').doPostBack('DockPositionChanged');" +
"}};" +
"Sys.Application.add_load(_addDock);", rdTemp.ClientID, sZone), true);

In General I get the registerStartupScript...

What what is the javascript doing? Can someone break it down?

This is from the portalsitecs.zip I downloaded.....

Appreciate some helpe with understanding it....

1 Answer, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 11 Apr 2008, 03:12 PM

1) Ajax is finished - newly created RadDock is on the page- but it is not docked, because it is added in the UpdatePanel
2)Sys.Application.add_load(_addDock);
function _addDock will be executed
3)Sys.Application.remove_load(_addDock);
function _addDock will not be executed anymore(It will be executed only once - when the RadDock is loaded for the first time on the page.)
4) $find('{1}').dock($find('{0}'));" - The newly created dock is docked in the RadDockZone
5) "$find('{0}').doPostBack('DockPositionChanged');"-DockPositionChanged event is fired on the server. A trigger is already added to the DockPositionChanged Event, so when it is fired the state will be saved on the server via AJAX

Tags
Dock
Asked by
Angela
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Share this question
or