Bootstrap grid inside re-sizable panels - html

I'm adding some new content to an old page that uses the Dojo library to create 2 panels, with a spacer in between that can be dragged left/right to expand/contract the panels. Think of it like a code editor with a split view between 2 files.
I was trying to put a form in one of the panels, and have it such that the form elements and labels stack when the panel gets small enough:
<form>
<div class="container">
<div class="form-group">
<div class="row">
<div class="col-md-1">
<label for="ID">Identifier</label>
</div>
<div class="col-md-5">
<select name="ID" id="ID">
<option value="1">1</option>
</select>
</div>
<div class="col-md-1">
<label for="Direction">Direction</label>
</div>
<div class="col-md-5">
<select name="Direction" id="Direction">
<option value="ASCENDING">ASCENDING</option>
<option value="DESCENDING">DESCENDING</option>
</select>
</div>
</div>
</div>
</div>
</form>
I noticed however that when resizing the panels, the grid behaviour wouldn't apply. It only applied when I actually resized the entire window.
Does bootstrap only use the size of the window for its grid, or can it be made such that it responds to a dynamically changing size of its parent component?

Yes, bootstap's grid system of 12 columns is based on the device or viewport size (i.e. Window size, or the visible page area inside window).
Here is for your reference
.col-xs- : Extra small devices Phones (<768px)
.col-sm- : Small devices Tablets (≥768px)
.col-md- : Medium devices Desktops (≥992px)
.col-lg- : Large devices Desktops (≥1200px)
if you are using v.3, here is the doc to refer link

Related

What explains the alignment, when resizing, in this bootstrap example

I have a bootstrap form in this jsfiddle and a simple label + textbox combo.
<div class="form-group">
<label class="col-md-4 control-label" for="af_Email">Email</label>
<div class="col-md-4">
<input id="af_Email" readonly="readonly" name="af_Email"
placeholder="" class="form-control input-md"
required="" value="frizzo#hotmail.com" type="email">
</div>
</div>
When page is expanded (assuming in the col-md-* range), labels right align and the margins are good and the page looks good.
When I shrink the page to something lesser than col-md-*, the labels left align, the margins to the panel are non-existent and it looks unprofessional:
How can I add margins (on both side of the panel) when page size lesser than col-md-*?
As a bonus question, can someone explain where in bootstrap this behavior is defined or documented?
Looks like you missed to add .col-md-12 before .form-group.
Here's the update: https://jsfiddle.net/ttb0xtn0/1/

How to display complete text when using bootstrap columns?

I have bootstrap columns that has two labels and two inputs From and To, So From input is showing text correct but To input is not showing complete text when i load data dynamically.How can i fix this issue using bootstrap or I have to use css helper class to make it work.
when we use low resolution monitors problems occurs most of the time e.g 1366 x 768
main.html
<div class="col-md-6 fieldHeight">
<div class="form-group">
<label for="issueFromDate" class="col-md-5">Issue Date
Range:</label>
<div class="col-md-7">
<div class="row">
<div class="col-md-5 changeWdh">
<input type="text" class="form-control"
ng-model="riskAssessmentDTO.issueFromDate"
name="issueFromDate" id="issueFromDate" disabled />
</div>
<div class="col-md-1">
<label class="control-label padd15"> To:</label>
</div>
<div class="col-md-5 changeWdh">
<input type="text" class="form-control"
ng-model="riskAssessmentDTO.issueToDate" name="issueToDate"
id="issueToDate" disabled />
</div>
</div>
</div>
</div>
</div>
I suggest you read more into the bootstrap grid system. You could use a mix of the different col- classes in order to make sure everything fits on the screen depending on the resolution. See this example:
Zoom and unzoom to see the grid system in action
Also, a date field always contains a maximum amount of characters. Therefore, you could set a min-width to the input

hide option value in Bootstrap select for certain devices

I have a Bootstrap select menu for a "state" form field. On larger devices, I have labels for each dropdown but on smaller devices, they are hidden. So in order for the smaller devices to know what the menu is for, I have the word "state" as the first dropdown option.
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">*State</label>
<div class="col-xs-5 col-lg-3">
<select id="state" class="form-control" name="state">
<option value="State">State</option>
<option value="AA">AA</option>...
Is there a better way to include the word "state" without it being an option value? Either way, how can I have it show for smaller devices, but remain hidden for larger devices (where the label will show)?
Thanks
You could use a media query to define the screensize:
#media (min-width: 768px) {
}
Then target whatever you didn't want to show within the CSS?

Can't change select form option when on smaller screens

I have a select form that has a list of currencies as options when my screen is at full size the select input works fine but the second I resize it to anything smalller I can only change my select option once. After that the clicks will not register and the mouse will not focus on the select unless I go back to a full sized screen. I also can't seem to reproduce the problem, I am using angular js
<div class="col-xs-6">
<select required="required" ng-model="currency" name="type" default-option="Select Currency" class="form-control m-b">
<option>Yuan</option>
<option>JPY</option>
<option>USD</option>
</select>
</div>

Boostrap - multiple input-group-addon on phone

I use Bootstrap 3 and i have a multiple datepicker (from - to). It work well on a compute however i have problem for mobile phone compatibility. My input group overflows the screen and do not resize all the group.
In case of small device, i would like to have the the group on 2 rows:
- the first with the addon From + its datepicker
- the second with the addon To + its datepicker
how could i do ?
my html:
<form class="form-horizontal">
<div class="form-group">
<div class="input-daterange" style="padding-left: 15px; padding-right: 15px" id="datepicker" >
<div class="input-group">
<div class="input-group-addon">From</div>
<input type="date" class="form-control" name="beginDate" id="beginDate"/>
<div class="input-group-addon" for="endDate">To</div>
<input type="date" class="form-control" name="endDate" id="endDate"/>
</div>
</div>
</div>
</form>
EDIT : I know it have to be done in css with #media, but how to get to the line only after the first datetimepicker ?
Bootstrap doesn't support multiple input fields within a single input group, regardless of browser:
Basic example
Place one add-on or button on either side of an input. You may also place one on both sides of an input.
We do not support multiple add-ons on a single side.
We do not support multiple form-controls in a single input group.
This would have to be done in the css.
So if you look at your bootstrap.css and scroll down to any #media 746px(I think its that many pixels it is for mobile) you should see examples of how they handle when the screen gets re sized. Mobile is just a screen size that is really small on a computer browser.