angular2 html does not always load - html

I am working with angular and I am having the issue that when my page loads, some of my text just does not display at all. Only after resizing the window makes it appear or , after refreshing a few times. It also does this with button text but in this example with the <b> tags. Below are two images, the first one is the one when the text does not laod, the second one is when i resize the window and the third one if I put ? in front of each value in the methods
Thanks for helping!
html code:
<div id="title">
<span>Stagevoorstellen</span>
</div>
<div class="dropdowns">
<div id="one">
<b>Status voorstel</b>
<select #selectedStatus class="form-control" (change)="checkStatus(selectedStatus.value)">
<option value="ToApprove">Nog te keuren</option>
<option value="Rejected">Afgekeurd</option>
</select>
</div>
<div id="two">
<div>
<b>Afstudeerrichting</b>
<select #selectedSpecialisation class="form-control" (change)="checkSpecialisation(selectedSpecialisation.value)">
<option value="EVERYTHING">Alles</option>
<option value="AON">Applicatieontwikkeling</option>
<option value="SWM">Softwaremanagement</option>
<option value="SNB">Systemen en netwerkbeheer</option>
</select>
</div>
</div>
<div id="three">
<div>
<b>Reviewer</b>
<select #reviewerYesOrNo class="form-control" (change)="checkReviewerForNull(reviewerYesOrNo.value)">
<option value="notAssigned">Niet toegekend</option>
<option value="assigned">Toegekend</option>
</select>
</div>
</div>
</div>

try this : add ? mark before each .value
<div id="title">
<span>Stagevoorstellen</span>
</div>
<div class="dropdowns">
<div id="one">
<b>Status voorstel</b>
<select #selectedStatus class="form-control" (change)="checkStatus(selectedStatus?.value)">
<option value="ToApprove">Nog te keuren</option>
<option value="Rejected">Afgekeurd</option>
</select>
</div>
<div id="two">
<div>
<b>Afstudeerrichting</b>
<select #selectedSpecialisation class="form-control" (change)="checkSpecialisation(selectedSpecialisation?.value)">
<option value="EVERYTHING">Alles</option>
<option value="AON">Applicatieontwikkeling</option>
<option value="SWM">Softwaremanagement</option>
<option value="SNB">Systemen en netwerkbeheer</option>
</select>
</div>
</div>
<div id="three">
<div>
<b>Reviewer</b>
<select #reviewerYesOrNo class="form-control" (change)="checkReviewerForNull(reviewerYesOrNo?.value)">
<option value="notAssigned">Niet toegekend</option>
<option value="assigned">Toegekend</option>
</select>
</div>
</div>
</div>

Related

How to access another child class from parent in JQuery?

I have my markup looks like:
<div class="col-md-12 mainDiv">
<div class="rowDiv"> <!--first row starts-->
<div class="a1">
<div class="form-group">
<div class="dropdown-container-skills">
<select class="dropdown-skills">
<option>Select Any</option>
<option value="S1">Skill 1</option>
<option value="S2">Skill 2</option>
<option value="S3">Skill 3</option>
</select>
</div>
</div>
</div>
<div class="a1">
<div class="form-group">
<div class="dropdown-container-topics">
<select class="dropdown-topics">
<option>Select Any</option>
<option value="T1">Topic 1</option>
<option value="T2">Topic 2</option>
<option value="T3">Topic 3</option>
</select>
</div>
</div>
</div>
</div><!--first row ends-->
<div class="rowDiv"> <!--second row starts-->
<div class="a1">
<div class="form-group">
<div class="dropdown-container-skills">
<select class="dropdown-skills">
<option>Select Any</option>
<option value="S1">Skill 1</option>
<option value="S2">Skill 2</option>
<option value="S3">Skill 3</option>
</select>
</div>
</div>
</div>
<div class="a1">
<div class="form-group">
<div class="dropdown-container-topics">
<select class="dropdown-topics">
<option>Select Any</option>
<option value="T1">Topic 1</option>
<option value="T2">Topic 2</option>
<option value="T3">Topic 3</option>
</select>
</div>
</div>
</div>
</div><!--second row ends-->
</div>
I want something like when I select skill from first row it will update topics in the first row itself. Also when I select skill from second row it will update topics in second row and so on. I wrote the script for this as:
$('body').on('change', '.dropdown-skills', function(e) {
$.ajax({
type: "GET",
url: 'getTopics/' + $(this).val(),
dataType : "html",
success: function(response)
{
$(this).closest('.rowDiv').find('.dropdown-container-topics').html(response);
}
});
});
ie when I change class dropdown-skills it will get the topics as html from the controller function and it is then fed into class dropdown-container-topics of the current row.
But this is not working. How can it be done?

Div loading outside form on mobile

I have a div inside a form that is loading within the form on desktop but jumps out of the form tag when it is loaded on mobile. here is the code:
<div class="small-12 medium-5 large-3 columns end">
<form id="video-filter" class="video-filter" method="post">
<h2>Filter by</h2>
<div class="select-videospage">
<label for="sort" class="select-wrapper select-dark select-dark--videos">
<select name="filterby">
<option value="new">Most recent</option>
<option value="views">Most viewed</option>
<option value="likes">Most liked</option>
</select>
</label>
<label for="sort" class="select-wrapper select-dark--time">
<select name="time">
<option value="all">All</option>
<option value="week">Weekly</option>
<option value="month">Monthly</option>
<option value="year">Yearly</option>
</select>
</label>
</div>
<div class="video-filter__choosen">
<ul>
<!-- checkbox values will be appended here -->
</ul>
<button id="clear">Clear all</button>
</div>
</form>
</div>
The div that is loading outside of the form is "select-videospage". I cant figure out why the template would load differently on the two.

How to align controls each other

i am trying to align html controls next to each other without giving huge space and I try to override the bootstrap .css but no luck.
here is my screen looks like:
I have created JSFiddle and also below is my html code.
JSFIDDLE
<div class="row">
<div class="col-xs-4">
<div class="form-group1">
<label class="col-xs-5 control-label" for="">Rows per page:</label>
<div class="col-xs-4">
<form action="/SystemAdmin" id="form_header_pager" method="post" name=
"form_header_pager">
<select class="form-control" data-val="true" data-val-number=
"The field PageSize must be a number." data-val-required=
"The PageSize field is required." id="PageSize" name=
"PageSizeSelect">
<option selected="selected" value="10">
10
</option>
<option value="25">
25
</option>
<option value="50">
50
</option>
<option value="ALL">
ALL
</option>
</select>
</form>
</div>
</div>
</div>
<div class="col-xs-4">
<div>
<div>
<b>Total records:</b> 0
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group1">
<label class="col-xs-5 control-label" for="">Show Records:</label>
<div class="col-xs-7">
<form action="/SystemAdmin" id="form_header_show_records" method="post"
name="form_header_show_records">
<select class="form-control" id="ShowRecords" name="showrecords">
<option value="all">
Show All Records
</option>
<option value="invalid">
Show Invalid Records
</option>
<option value="valid">
Show Valid Records
</option>
</select>
</form>
</div>
</div>
</div>
</div>
The big spaces within your layout are caused from using the grid column widths. Bootstrap provides inline form element styling and it's recommended to use that instead of the grid columns.
The additional CSS adjustment I had to make was your totals area. Since it didn't have an input or select element, the vertical alignment was slightly off. If you had a row of inputs (as show in Bootstrap's documentation), you wouldn't need any additional CSS here.
You can view this corrected code snippet below. Please note that you must run it in "Full Page" mode to view it correctly. By default the form-inline tool only works in viewports greater than 768px.
.record-results {
display: inline-block;
margin-bottom: 3px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-inline">
<div class="form-group">
<form action="/SystemAdmin" id="form_header_pager" method="post" name="form_header_pager">
<label for="PageSize">Rows per page:</label>
<select class="form-control" data-val="true" data-val-number="The field PageSize must be a number." data-val-required="The PageSize field is required." id="PageSize" name="PageSizeSelect">
<option selected="selected" value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="ALL">ALL</option>
</select>
</form>
</div>
<div class="form-group ">
<span class="record-results"><strong>Total records:</strong> 0</span>
</div>
<div class="form-group">
<form action="/SystemAdmin" id="form_header_show_records" method="post" name="form_header_show_records">
<label for="showrecords">Show Records:</label>
<select class="form-control" id="ShowRecords" name="showrecords">
<option value="all">Show All Records</option>
<option value="invalid">Show Invalid Records</option>
<option value="valid">Show Valid Records</option>
</select>
</form>
</div>
</div>
JSBIN
your layout is confused me. So I did another to achieve.
The key code:
<form class="form-inline">
<div class="form-group">
<label for="exampleInputName2">Rows per page:</label>
<select name="" id="" class="form-control">
<option value="1">test</option>
<option value="1">test</option>
<option value="1">test</option>
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail2">Total records:</label>
<span class="text-danger">99</span>
</div>
<div class="form-group">
<label for="exampleInputName2">Show Records:</label>
<select name="" id="" class="form-control">
<option value="1">test</option>
<option value="1">test</option>
<option value="1">test</option>
</select>
</div>
</form>

bootstrap 3 show label in inline selectbox

I set label for select box menu in bootstrap 3 like this :
<div class="col-lg-2">
<label>Filter</label>
<select class="form-control" name="sort">
<option value="1">1</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
</select>
</div>
in output in see label in top of select box menu:
I need to show label inline of select box menu like this :
how do show label in inline ?!
DEMO JSFIDDLE
You need put your label and your select inside of a "group", so we have this:
<div class="form-group">
<label for="sort" class="col-sm-2 control-label"> Filter </label>
<div class="col-sm-10">
<select class="form-control" name="sort" id="sort">
<option value="1">1</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
</select>
</div>
</div>
You want form-inline - This example works in full screen mode (not sure why this code snippet wraps when not in full screen mode) but give it a whirl it should work for you.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<form class="form-inline">
<div class="form-group">
<label for="dashboard-filter">Filter By</label>
<select id="dashboard-filter" class="form-control">
<option>1</option>
<option>2</option>
</select>
</div>
</form>
Docs are here: https://getbootstrap.com/docs/3.4/css/#forms-inline

Form get - remove the not selected

I have a html form
<form method="get" action="http://domainn.com/">
<div class="item">
<span>order_by</span>
<select class="input" name="order_by">
<option value="">DF</option>
<option value="id">id</option>
<option value="year">year</option>
</select>
</div><div class="item">
<span>category</span>
<select class="input" name="category">
<option value="">DF</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>
<div>
<input type="submit" class="btn" value="Search">
</div>
</form>
When clicking on it will move to buttu find links domain/?order_by=&category =
I want only values ​​are selected to appear on the link
For example, just select the category that it will not switch to select order_by domain/?category=1 not link domain/?order_by=&category=1