Basically Currently I have html code which builds a layout of panels and I want to basically expand and collapse these panels , for some reason when i load the assets and run my app , the panels appear collapsed but does not expand when i click the panel title the code is below , i am using angular js with html5 . if someone can help quick i would appreciate that.
<div class="row clearfix" >
<div ng-repeat="i in ctrl.coreControlpanelItems" class="col-md-12 column" >
<div ng-class="{'panel-primary': hover}" ng-mouseenter="hover = true" ng-mouseleave="hover = false" class="panel panel-default animated fadeInUp">
<div class="panel-heading">
<i class="pull-left {{i.icon}}"/>
<h5 class="panel-title">
<a href="#" ng-model="collapsed" ng-click="collapsed=!collapsed">
<a ui-sref="{{i.ref}}">{{i.group}}</a>
</a>
</h5>
</div>
<div ng-show="collapsed">
<div class="panel-body ">
<ul>
<li ng-repeat="s in i.items"><a ui-sref="{{s.ref}}">{{s.name}}<a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
First of all, you have nested a tags in your panel-title element. That's a no-no.
Second, you're can't put ng-model on an a tag.
Third, your panel-title is supposed to expand something but you also have a link inside of it which if clicked on would negate what you're trying to do with the expanding...
Related
I'm creating a dashboard,and created sidebar menu using bootstrap grid.Now I want when I click any sidebar menu's routerLink. my objective is open that link in next column of the row,as usually happens in dashboards/admin panel.
But here in my case,when I click the link it goes to next page.
<div class="row">
<div class="col-sm-2">
<div class="list-group">
<a routerLink="dashboard" class="list-group-item active"> Dashboard</a>
<div>
<a class = "list-group-item" data-toggle="collapse"
href="#collapse1">Accessories</a>
<div id="collapse1" class="panel-collapse collapse bgColor">
<div class="list-group">
<a routerLink ="add-new" class="list-group-item">Add new Accessory</a>
<a routerLink ="view-accessories" class="list-group-item">View Accessories</a>
</div>
</div>
</div>
</div>
</div>
<div class="col">
</div>
</div>
I expect the output that link should be open in next column of row.
but here in my case it goes to next page. how to resove this.[enter image description here][1]
[1]: https://i.stack.imgur.com/DVyLQ.jpg
That it usually achieved by having a layout where constant elements (like dashboard) are outside the router outlet. Say, in your AppComponent:
<app-navbar></app-navbar>
<app-vertical-nav></app-vertical-nav>
<router-outlet></router-outlet>
<app-footer></app-footer>
I as trying to make a pointing drop down, and it is as Semantic UI's documentation says it should be, but it didn't open to the side when I click,I might be missing something, can you guys help me?
<pre>
<div class="ui vertical menu">
<div class="header item">
Exemplos
</div>
<div class="ui left pointing dropdown link item">
<i class="dropdown icon"></i>
Imagem
<div class="menu">
<div class="item" routerLink="images"
RouterLinkActive="active">Reconhecimento de Objetos</div>
<div class="item">Reconhecimento Facial</div>
</div>
</div>
</div>
</pre>
The Semantic UI dropdown module requires some JavaScript for it to work properly. To just get the menu to show, you can use angular to perform the necessary Javascript work.
<div class="ui vertical menu">
<div class="header item">
Exemplos
</div>
<div class="ui left pointing dropdown link item" ngClass="{'visible': showMenu, 'active': showMenu}">
<i class="dropdown icon" (click)="showMenu = !showMenu"></i>
Imagem
<div class="menu" ngClass="{'visible': showMenu, 'hidden': !showMenu}">
<div class="item" routerLink="images"
RouterLinkActive="active">Reconhecimento de Objetos</div>
<div class="item">Reconhecimento Facial</div>
</div>
</div>
</div>
This won't apply the classes with the proper timing though to do the animations that Semantic UI provides as well. To do that you will have to load the requisite js libraries(jQuery and semantics js files) and get them to play nicely with Typescript.
I have a website that displays many real-time graphs and gauges, all hidden within drawers initially. The graphs are made with the plotly.js library. The gauges are done with JustGage. The code for the containers is as such:
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-5 statistics">
<div class="centered-text">
<div class="container-fluid">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-heading">Statistics Panel</h3>
</div>
<ul class="list-group">
<!-- Base Station Panel -->
<li class="list-group-item">
<div class="row toggle" id="dropdown-detail-1" data-toggle="detail-1">
<div class="col-lg-10 text-left">
Base Station
</div>
<div class="col-lg-2"><i class="fa fa-chevron-down pull-right"></i></div>
</div>
<div id="detail-1">
<hr></hr>
<div class="container-fluid">
<div class="fluid-row">
<div class="col-lg-6">
<div id="happygraph1"></div>
<input id="happybutton1" type="button" value="View History"
onclick="happygraph1.changeMode();"/>
</div>
<div class="col-lg-6">
<div id="happygraph2"></div>
<input id="happybutton2" type="button" value="View History"
onclick="happygraph2.changeMode();"/>
</div>
</div>
<div class="fluid-row">
<div class="col-lg-6">
<div id="happygraph3"></div>
<input id="happybutton3" type="button"
value="View History" onclick="happygraph3.changeMode();"/>
</div>
</div>
<div class="container-fluid">
<div class="fluid-row">
<div class="col-sm-6">
<div id="happygauge1 style="height: 250px; width: 300px;"></div>
</div>
</div>
<div class="col-sm-6">
<div id="happygauge2" style="height: 250px; width: 300px;"></div>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
The issue is that when the page loads, if the data begins appearing on the graphs before the hidden element is expanded, the graphs' containers extend out of the newly expanded element. However, if the element is expanded first, and then the data comes in, it acts exactly how it should. There is no issue with the gauges.
Here is a screenshot of when it's working:
graph containers stay within element
Here is a screenshot of when the element is expanded after the data has started being drawn: graph containers expand out of element
The drawers (and the layout in general) is done up by bootstrap. What is causing the containers to break? I have tried playing with the fluid row and container properties, however to no avail. Thanks in advance.
It seems the issue was not with Bootstrap at all but with some of the layout options set in Plotly. Plotly was sizing the graphs to be much larger than the container only when loaded hidden.
I need to collapse other component from a button. So I have a directive name collapse and I want to set target collapseme to the diretive.
<div class="panel-heading">
<h4 class="panel-title">
<a [collapse]="isColapse" [collapseTarget]="collapseme" (click)="isColapse= !isColapse">
</a>
</h4>
</div>
<div id="collapseme">
<div class="panel-body">
collapse content
</div>
</div>
But I cant find solution for it. Do you have any solution?
Add a template variable #collapseme
<div class="panel-heading">
<h4 class="panel-title">
<a [collapse]="isColapse" [collapseTarget]="collapseme" (click)="isColapse= !isColapse">
</a>
</h4>
</div>
<div id="collapseme" #collapseme> <!-- modified -->
<div class="panel-body">
collapse content
</div>
</div>
It seems you have used bootstrap. You can do it via bootstrap
collapse
Hi guys been playing around with the bootstrap pannels and trying to understand it all. I am trying to recreate some panels inside other panels.
So for example this website : Website
Is using bootstrap pannels for their recopies. This is what i am trying to recreate with panels however i am not sure how 2 do this.
I have done this so far however it does not look like the one on the website at all
Code:
<div id="mainContainer" class="container">
<div class = "pannels">
<div class="panel panel-default">
<div class="panel-heading">Panel Title</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
<div class="panel panel-default">
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<button type="button" class="btn btn-success">Success</button>
</div>
</div>
<div class="col-lg-10 col-md-9 col-sm-8 col-xs-6">
<h4>
List Title
</h4>
<ul class="list-group">
<li class="list-group-item">Item One</li>
<li class="list-group-item">Item Two</li>
<li class="list-group-item">Item One</li>
<li class="list-group-item">Item Two</li>
<li class="list-group-item">Item One</li>
</ul>
</div>
</div>
</div>
<div class="panel-footer">
Here comes some text
</div>
</div>
</div>
</div>
I am trying to get everything to the right size. So for example my picture tab is not the right size compared to the site and i am having problem recreating it. I also am struggling to shrink the whole window pannel . I am not sure if i should use CSS to do this or bootstrap etc.
Anyway any help on this would be great .
Thanks
Use CSS. So in your head tag add a link to your own CSS file which adds the styles you want. But make sure it is listed after you link the Bootstrap CSS file.
Ex.
<link rel="stylesheet" type="text/css" href="--Bootstrap URL Here--"/>
<link rel="stylesheet" type="text/css" href="myCustomCSSFile.css"/>
Then inside myCustomCSSFile.css put things like:
panel > panel {
height: 50%;
background-color: orange;
}
or whatever styles you want.
Here's a CSS tutorial: W3Schools CSS Tutorial