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

OnClientDragStart...with AutoPostBack=true

3 Answers 77 Views
Dock
This is a migrated thread and some comments may be shown as answers.
JQ
Top achievements
Rank 1
JQ asked on 06 Sep 2007, 04:22 PM
Hi
I have UpdatePanel, RadDocks, RadDockZones, and RadDockLayout created dynamically. All the Docks are set AutoPostBack=true, and they are outside the UpdatePanel but UpdatePanel is configured to conditionally ajaxify the docks.

I have developed a portal where, in design mode, you can move around the contents and the layout is saved automatically.

Now I added a new feature, where the content is hidden while being dragged.

I made use of the following javascript code,
var oldcontainer;   
var oldbackground;   
function RadDockOnDragStart(dock,args){ 
    var container = dock._element; 
    oldcontainer = container.innerHTML;   
    oldbackground = container.style.backgroundColor;   
    container.innerHTML='';   
    container.style.backgroundColor = 'Orange';   
function RadDockOnDragEnd(dock,args){ 
    var container = dock._element;   
    container.innerHTML=oldcontainer;   
    container.style.backgroundColor = oldbackground;     

of course the OnClientDragStart and OnClientDragEnd are set to those functions.

The problem is that this works only once for each of the docks. When I start the drag, the dock becomes Orange panel, and when I drop it, it restores the original content. However, that dock can no longer be dragged... and the post back didn't seem to occur because when I refresh the page by pressing F5, the layout has not been saved.

What's wrong with the javascript?

3 Answers, 1 is accepted

Sort by
0
JQ
Top achievements
Rank 1
answered on 06 Sep 2007, 07:21 PM
I need a way to hide/substitute the content of the Dock while dragging...
Because some of the controls I'm adding to my docks are quite complicated and dragging is unacceptably slow.
0
Cameron Tabor
Top achievements
Rank 1
answered on 06 Sep 2007, 07:53 PM
I'm having a similar problem  with the dragging being slow.  When I replaced the content with the orange panel, it still didn't improve the performance.  My problem seems to be more global even.  When I just put a few lines of text in the dock, it is still slow.  I'll be interested in knowing if anyone else has experienced/fixed this.

The Telerik demo site works great however.  I am going to try an write a sample app to isolate what is going on.
0
Cameron Tabor
Top achievements
Rank 1
answered on 07 Sep 2007, 07:53 PM
FYI, setting debug="false" in the compilation element of the web.config helped the performance for me tremendously.   Even though I was skeptical and can't imagine what that would have to do with client script code.   Here is the thread where it is recommended.

http://www.telerik.com/community/forums/thread/b311D-httch.aspx

-Cameron
Tags
Dock
Asked by
JQ
Top achievements
Rank 1
Answers by
JQ
Top achievements
Rank 1
Cameron Tabor
Top achievements
Rank 1
Share this question
or