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

OnClientCollapsed fired when sliding pane docked (pinned)

1 Answer 8 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
jlj30
Top achievements
Rank 2
jlj30 asked on 23 Mar 2015, 07:01 PM
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

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 26 Mar 2015, 03:30 PM
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.

 
Tags
Splitter
Asked by
jlj30
Top achievements
Rank 2
Answers by
Vessy
Telerik team
Share this question
or