OnClientCollapsed fired when sliding pane docked (pinned)

2 posts, 0 answers
  1. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 23 Mar 2015 Link to this post

    Hi,

    I need to react when a RadSlidingPane is expanded or collapsed.
    To this end, I have the following declaration:

    <telerik:RadSlidingZone ID="rszRight" runat="server" Width="22px" SlideDirection="Left">
    <
    telerik:RadSlidingPane ID="rspDetails" Title="Task Details" runat="server" Width="170px" OnClientCollapsed="rspDetails_Collapsed" OnClientExpanded="rspDetails_Expanded" >
    ...

    Simply hovering over the pane's tab causes the OnClientExpanded event to fire (see green arrows in attachment).  This is as expected.
    The problem is that the OnClientCollapsed event is firing when I click on the pin (dock) icon - not what I expected (see red arrow).
    See the attached screenshot and note the console log at the bottom.

    Am I doing something wrong?

    Thanks in advance for any suggestions.

    Jim

  2. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 26 Mar 2015 Link to this post

    Hi Jim,

    Indeed part of the current docking logic is to collapse the slidingPane before it gets docked. I have logged that behavior for a feature improvement and updated your Telerik points accordingly for the report.

    For the time being you can try the following override, removing the part of the code firing the ClientCollapse event.
    Telerik.Web.UI.RadSlidingPane.prototype._dockElement_OnMouseDown = function (e)
    {
        if (e.button && e.button != 1) return true;
     
        if(!this.get_expanded()) return;
     
        var zone = this._getSlidingZone();
        //if(!zone.collapsePane(this.get_id(), true)) return;
     
        zone.dockPane(this.get_id());  
        this.getDockIconElement().className = "rspSlideHeaderDockIcon";
    }

    Please, note, that this is a sample solution which is not fully tested and might bring unexpected issues.

    Regards,
    Vessy
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top