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

Problem since update

6 Answers 87 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Mark Davison
Top achievements
Rank 1
Mark Davison asked on 26 Sep 2007, 10:18 AM
Hi,

I have recently installed the new version as I wanted to use the editor.

As a result of this, some of my existing code has stopped working! I have no idea what to do!!!

The code is:

switch(eventArgs.Command.get_Name()) {

case 'DOWN':

var cid = sender.get_RadDock().get_id();

var dockZoneID = sender.get_RadDock().get_DockZoneID();

var dock=$find(cid);

var currheight=parseFloat(dock.get_element().style.height); //dock.get_Height();

var minheight=(document.getElementById('txtmin'+cid).value);

dock.get_element().style.height = parseFloat(currheight)+parseFloat(minheight) + 'px';

currheight=parseFloat(dock.get_element().style.height);

dock._setContentContainerHeight();

SaveDockLayout(dockZoneID,cid,"","",document.getElementById("hidSrcFile").value,currheight)

break;


It is this line that is currently giving me problems:

var cid = sender.get_RadDock().get_id();

Have any of the raddock methods changed in the new release?

Regards,

Mark

6 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 26 Sep 2007, 01:09 PM
Hello Mark Davison,

Which client-side event are you handling with this code? One change we did make which might well be your problem is that when handling OnClientCommand of a command (not the dock's OnClientCommand ) you pass two parameters, for example:

OnClientCommand(sender, args)

Until now sender was the command object itself, whereas we changed it to be the dock whose command has raised the event. If this is your case, then using sender.get_id(); instead of sender.get_RadDock().get_id(); should solve the problem. In case you have a different scenario, please provide more detailed information about it so we can help you as soon as possible.

All the best,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark Davison
Top achievements
Rank 1
answered on 26 Sep 2007, 01:22 PM
Hi,

It was the OnClientCommand of a command that I was using. You found (and solved) the problem for me. Thank you!

Can you tell me if anything has changed with 

var loc = $telerikCommon.getLocationWithScrollOffset(commandElement);

I am now getting the loc.x position reported as much less than it should be! I have just noticed this now that my buttons are working again but while I am trying to figure out what has happened, I thought I would check with you.

Regards,

Mark

0
Petya
Telerik team
answered on 26 Sep 2007, 01:39 PM
Hi Mark Davison,

I do not think that this method was changed. After you check your code, if you continue to get abnormal results using this method, please provide us with running code reproducing the issue so we can investigate the matter locally.

Sincerely yours,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark Davison
Top achievements
Rank 1
answered on 26 Sep 2007, 01:50 PM
Hi,

The problem is related to the change you made. Before, we used:

var commandElement = sender.get_element();
var loc = $telerikCommon.getLocationWithScrollOffset(commandElement);

This gave us the position of the command item itself. Now that you have changed the Sender to be the dock, we are getting the position of the dock. How can I set the commandElement to the command item itself? We need this to position a div below it.

Regards,

Mark

0
Petya
Telerik team
answered on 26 Sep 2007, 02:20 PM
Hi Mark Davison,

You can use the second parameter passed to OnClientCommand:

function OnClientCommand(sender, args)
{
    var commandElement = args.Command.get_element();
}

Hope we have been helpful.

Kind regards,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark Davison
Top achievements
Rank 1
answered on 26 Sep 2007, 02:28 PM
Hi Petya,

You have been very helpful! Thank you very much.

Regards,

Mark
Tags
Dock
Asked by
Mark Davison
Top achievements
Rank 1
Answers by
Petya
Telerik team
Mark Davison
Top achievements
Rank 1
Share this question
or