Problem since update

7 posts, 0 answers
  1. Mark Davison
    Mark Davison avatar
    82 posts
    Member since:
    Jul 2005

    Posted 26 Sep 2007 Link to this post

    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

  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 26 Sep 2007 Link to this post

    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
  3. Mark Davison
    Mark Davison avatar
    82 posts
    Member since:
    Jul 2005

    Posted 26 Sep 2007 Link to this post

    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

  4. Petya
    Admin
    Petya avatar
    869 posts

    Posted 26 Sep 2007 Link to this post

    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
  5. Mark Davison
    Mark Davison avatar
    82 posts
    Member since:
    Jul 2005

    Posted 26 Sep 2007 Link to this post

    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

  6. Petya
    Admin
    Petya avatar
    869 posts

    Posted 26 Sep 2007 Link to this post

    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
  7. Mark Davison
    Mark Davison avatar
    82 posts
    Member since:
    Jul 2005

    Posted 26 Sep 2007 Link to this post

    Hi Petya,

    You have been very helpful! Thank you very much.

    Regards,

    Mark
Back to Top