Extending Sidebar with a button similar to Google Maps

Hello,


I'm new to Angular, but in the past days i successfully the <ejs-sidebar> component to my project. It looks great and works also very well.

I'm currently experiencing to implement a button, similar to the button used on Google-Maps to open/hide the sidebar (see the area marked with a red circle on the screenshot).

I would like to place the button at the right edge and in the middle of the sidebar (similar to Google Maps).

At the moment without any success.


Is it even possible to extend this sidebar ?

If yes, can you give me some hint, how to go on with the implementation ?


Thanx in advance,

Best Regards,

Daniel


9 Replies 1 reply marked as answer

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team December 1, 2021 09:08 AM UTC

Hi Daniel, 
 
Greetings from Syncfusion support. 
 
We checked your expected requirement on Sidebar and prepared a demo sample with a Sidebar which opens/collapses when clicking on the sticky button which is placed outside the Sidebar element using position styles. 
 
Please refer to the following sample. 
 
 
Also, check out the following links to know more about Sidebar component. 
 
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Shameer Ali Baig S. 



DT Daniel Tahin December 2, 2021 11:25 AM UTC

Thank you very much for the demo code. It is exactly, what i was looking for. You really saved my day :-)




KR Keerthana Rajendran Syncfusion Team December 3, 2021 05:40 AM UTC

Hi Daniel, 

Most welcome. We are happy to hear that the provided sample helped you. Please get back to us if you need any further assistance. We will be happy to assist you. 

Regards, 
Keerthana R. 



DT Daniel Tahin December 10, 2021 10:46 PM UTC

I extended the sidebar with an "ejs-treeview"  (code). This also worked very fluently with very little effort. Unfortunately there are 2 things where I would need your help :-).


1) If the text is too long (e.g. the menu item "Components" -> "Calendar and some other things"), the text should be wrapped in several lines, but the horizontal scrollbar should not apear at the bottom. It would be also good if you could click on all the lines of the text. At the moment you can only click on the first line. There are already CSS instructions from me in treeview.css, in the line / * word wrap * /, but it doesn't work completely.


2) Is there a way to add a vertical scrollbar without the sticky button disappearing ? For example, if you open both menu items "Components" and "API Reference", then you cannot see all the submenu items. (When I added the vertical scrollbar, the sticky button was no longer visible.)


Thank you again for your support,

Daniel




SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team December 13, 2021 09:01 AM UTC

Hi Daniel, 

We have checked your expected requirements on TreeView and Sidebar components.  

Query 1: It would be also good if you could click on all the lines of the text. At the moment you can only click on the first line. 

We have added the solution to meet this requirement in your shared sample. Also, please check out the following link to know about the solution. 



Query 2: Is there a way to add a vertical scrollbar without the sticky button disappearing ? (When I added the vertical scrollbar, the sticky button was no longer visible.) 

We can add vertical scrollbar to the TreeView by adding height and overflow CSS styles. In our last shared sample, we have set left with static value for your reference. However, now we have updated with percentage unit and removed the width of the Sidebar. So, it would adapt the width of TreeView. Using these changes, you can resolve your reported problem. 


Please revert if you need any further assistance. 

Regards, 
Shameer Ali Baig S. 



DT Daniel Tahin December 15, 2021 07:31 PM UTC

Thank you very much for your help.


It worked very good.

I have an additional question to query 2.


Is it also possible to display the vertical scrollbar but keeping the width of the Sidebar unchanged and let the Treeview fill the remaining vertical space ?


After a while somehow i realized a solution, to completely hide both of the scrollbars, but allowing the scrolling. To (re)calculate the height of the Treeview (to fill the remaining space) i used a window-listener.


Is it so, that a fixed height has to be supplied to allow the scrolling ?



Thank you again for your assistance,

Daniel




KR Keerthana Rajendran Syncfusion Team December 16, 2021 11:57 AM UTC

Hi Daniel, 
 
Most welcome. 
 
We are glad that the provided suggestion helped you. 
Query: Is it also possible to display the vertical scrollbar but keeping the width of the Sidebar unchanged and let the TreeView fill the remaining vertical space ? 
  
Yes, it is possible to display the vertical scrollbar with same width of Sidebar. In the previous sample, width of Sidebar is changed based on the text length of expanded tree nodes.  
 
If the text length doesn't exceed the Sidebar width, then it remains the same.  
 
 
Query: Is it so, that a fixed height has to be supplied to allow the scrolling ? 
 
Yes, the TreeView element must contain a certain height and overflow as auto to allow scrolling when the height exceeds. 
 
Regards, 
Keerthana R.  


Marked as answer

DT Daniel Tahin December 17, 2021 08:33 PM UTC

Thank you again for your support.



KR Keerthana Rajendran Syncfusion Team December 20, 2021 06:11 AM UTC

Hi Daniel, 

Most welcome. Please get back to us if you need any further assistance. We will be happy to assist you. 

Regards, 
Keerthana R. 


Loader.
Up arrow icon