Skip to content

Commit a508c61

Browse files
Merge pull request #4678 from syncfusion-content/EJ2-998122-coremvc-adron
998122: Including Adronments feature into UG documentation
2 parents 2920fbe + 2ac17c9 commit a508c61

File tree

22 files changed

+1107
-0
lines changed

22 files changed

+1107
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public ActionResult adornments()
2+
{
3+
return View();
4+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@using Syncfusion.EJ2.Inputs
2+
@using Syncfusion.EJ2.DropDowns
3+
@using EJ2MVCSampleBrowser.Models
4+
@using Syncfusion.EJ2
5+
@section ControlsSection {
6+
<div class="control-section">
7+
<div class="col-lg-12 control-section">
8+
<div class="content-wrapper mask-row">
9+
@Html.EJS().MaskedTextBox("maskTemplate").Mask("0000-000-000").PromptChar("#").Placeholder("Enter phone number").FloatLabelType(FloatLabelType.Auto).PrependTemplate("<span id=\'user\' class=\'e-icons e-user\' title=\'User\'></span><span class=\'e-input-separator\'></span>").AppendTemplate("<span class='e-input-separator'></span><span id='sendIcon' class='e-icons e-send'></span>").Render()
10+
</div>
11+
</div>
12+
}
13+
14+
@*custom code start*@
15+
<style>
16+
.content-wrapper {
17+
width: 30%;
18+
margin: 0 auto;
19+
min-width: 250px;
20+
}
21+
.control-label {
22+
padding: 24px 0px 10px 0px;
23+
font-size: 12px;
24+
}
25+
.mask-row label.e-float-text,
26+
.mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
27+
.mask-row .e-float-input.e-control-wrapper:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
28+
margin-top: -2px;
29+
}
30+
.bootstrap5\.3 .mask-row .e-prepend-template,
31+
.bootstrap5\.3-dark .mask-row .e-prepend-template,
32+
.tailwind3 .mask-row .e-prepend-template,
33+
.tailwind3-dark .mask-row .e-prepend-template,
34+
.e-bigger.material3 .mask-row .e-prepend-template,
35+
.e-bigger.material3-dark .mask-row .e-prepend-template {
36+
padding-right: 0 !important;
37+
}
38+
.fluent2 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
39+
.fluent2-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
40+
.fluent2-highcontrast .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
41+
top: -9px !important;
42+
}
43+
.e-bigger.material3 .mask-row .e-maskedtextbox,
44+
.e-bigger.material3-dark .mask-row .e-maskedtextbox {
45+
padding-left: 10px !important;
46+
}
47+
.e-bigger.material3 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
48+
.e-bigger.material3-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
49+
top: -3px !important;
50+
padding-left: 10px !important;
51+
}
52+
.e-bigger.bootstrap5\.3 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
53+
.e-bigger.bootstrap5\.3-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
54+
top: 20px !important;
55+
}
56+
.e-bigger.fluent2 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
57+
.e-bigger.fluent2-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
58+
.e-bigger.fluent2-highcontrast .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
59+
margin-top: 0 !important;
60+
}
61+
</style>
62+
@*custom code end*@
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@page
2+
@using EJ2CoreSampleBrowser.Models
3+
@using Syncfusion.EJ2
4+
5+
@section ControlsSection{
6+
<div class="col-lg-12 control-section">
7+
<div class="content-wrapper">
8+
<div class="mask-row">
9+
<ejs-maskedtextbox id="maskTemplate" mask="0000-000-000" promptChar="#" placeholder="Enter phone number" floatLabelType="Auto"
10+
prependTemplate="@Html.Raw("<span id='user' class='e-icons e-user' title='User'></span><span class='e-input-separator'></span>")"
11+
appendTemplate="@Html.Raw("<span class='e-input-separator'></span><span id='sendIcon' class='e-icons e-send'></span>")">
12+
</ejs-maskedtextbox>
13+
</div>
14+
</div>
15+
</div>
16+
}
17+
@*custom code start*@
18+
<style>
19+
.content-wrapper {
20+
width: 30%;
21+
margin: 0 auto;
22+
min-width: 250px;
23+
}
24+
.control-label {
25+
padding: 10px 0px 5px 0px;
26+
font-size: 12px;
27+
}
28+
.material .e-prepend-mask .e-append-template .e-icons.e-send:before,
29+
.material-dark .e-prepend-mask .e-append-template .e-icons.e-send:before,
30+
.fabric .e-prepend-mask .e-append-template .e-icons.e-send:before,
31+
.fabric-dark .e-prepend-mask .e-append-template .e-icons.e-send:before,
32+
.bootstrap .e-prepend-mask .e-append-template .e-icons.e-send:before,
33+
.bootstrap-dark .e-prepend-mask .e-append-template .e-icons.e-send:before,
34+
.bootstrap4 .e-prepend-mask .e-append-template .e-icons.e-send:before,
35+
.highcontrast .e-prepend-mask .e-append-template .e-icons.e-send:before {
36+
content: '\e816' !important;
37+
}
38+
.mask-row label.e-float-text,
39+
.mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
40+
.mask-row .e-float-input.e-control-wrapper:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
41+
margin-top: -2px;
42+
}
43+
.bootstrap5\.3 .mask-row .e-prepend-template,
44+
.bootstrap5\.3-dark .mask-row .e-prepend-template,
45+
.tailwind3 .mask-row .e-prepend-template,
46+
.tailwind3-dark .mask-row .e-prepend-template {
47+
padding-right: 0 !important;
48+
}
49+
.fluent2 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
50+
.fluent2-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
51+
.fluent2-highcontrast .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
52+
top: -8px !important;
53+
}
54+
.e-bigger.material3 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
55+
.e-bigger.material3-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
56+
top: -3px !important;
57+
}
58+
.e-bigger.bootstrap5\.3 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
59+
.e-bigger.bootstrap5\.3-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
60+
top: 20px !important;
61+
}
62+
.e-bigger.fluent2 .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
63+
.e-bigger.fluent2-dark .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom,
64+
.e-bigger.fluent2-highcontrast .mask-row .e-float-input:not(.e-error):not(.e-input-focus) input:not(:focus):valid~label.e-float-text.e-label-bottom {
65+
margin-top: 0 !important;
66+
}
67+
</style>
68+
@*custom code end*@
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public ActionResult adornments()
2+
{
3+
return View();
4+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
@using Syncfusion.EJ2.Inputs
2+
@using Syncfusion.EJ2.DropDowns
3+
@using EJ2MVCSampleBrowser.Models
4+
@using Syncfusion.EJ2
5+
@section ControlsSection {
6+
<div class="col-lg-12 control-section">
7+
<div class="content-wrapper">
8+
<div class="row custom-margin e-prependtemplate">
9+
@Html.EJS().NumericTextBox("prepend").Value(1).Placeholder("Enter the price").FloatLabelType(FloatLabelType.Auto).PrependTemplate("<span id=\'menu\' class=\'e-icons e-menu\' title=\'Menu\'></span><span class=\'e-input-separator\'></span><span id=\'search\' class=\'e-icons e-search\' title=\'Search\'></span><span class=\'e-input-separator\'></span>").Created("onPrependCreated").Change("onPriceChange").Render()
10+
</div>
11+
<div class="row custom-margin e-appendtemplate">
12+
@Html.EJS().NumericTextBox("append").Value(5).Placeholder("Enter the kg").FloatLabelType(FloatLabelType.Auto).AppendTemplate("<span>kg</span>").Change("onKgChange").Render()
13+
</div>
14+
<div class="row custom-margin custom-margin-row e-icontemplate">
15+
@Html.EJS().NumericTextBox("icontemplate").Value(10).Placeholder("Enter the Number").FloatLabelType(FloatLabelType.Auto).ShowSpinButton(false).Created("onIconTemplateCreated").PrependTemplate("<span id='reset' class='e-icons e-reset' title='Reset'></span><span class='e-input-separator'></span>").AppendTemplate("<span class='e-input-separator'></span><span id='subract' class='e-icons e-horizontal-line'></span><span class='e-input-separator'></span><span id='plus' class='e-icons e-plus'></span>").Render()
16+
</div>
17+
</div>
18+
</div>
19+
}
20+
21+
<script type="text/javascript">
22+
function onPrependCreated() {
23+
var prefixLabel = new ej.dropdowns.DropDownList({width: '60px'});
24+
prefixLabel.appendTo('#select');
25+
}
26+
function onPriceChange() {
27+
var prependNumeric = document.getElementById("prepend").ej2_instances[0];
28+
var appendNumeric = document.getElementById("append").ej2_instances[0];
29+
appendNumeric.value = prependNumeric.value * 5;
30+
appendNumeric.dataBind();
31+
}
32+
function onKgChange() {
33+
var prependNumeric = document.getElementById("prepend").ej2_instances[0];
34+
var appendNumeric = document.getElementById("append").ej2_instances[0];
35+
prependNumeric.value = appendNumeric.value / 5;
36+
prependNumeric.dataBind();
37+
}
38+
function onIconTemplateCreated() {
39+
var resetSpan = document.querySelector('#reset');
40+
if (resetSpan) {
41+
resetSpan.addEventListener('click', function() {
42+
var iconNumeric = document.getElementById("icontemplate").ej2_instances[0];
43+
iconNumeric.value = 0;
44+
iconNumeric.dataBind();
45+
});
46+
}
47+
var subractSpan = document.querySelector('#subract');
48+
if (subractSpan) {
49+
subractSpan.addEventListener('click', function() {
50+
var iconNumeric = document.getElementById("icontemplate").ej2_instances[0];
51+
iconNumeric.value = iconNumeric.value - 1;
52+
iconNumeric.dataBind();
53+
});
54+
}
55+
var plusSpan = document.querySelector('#plus');
56+
if (plusSpan) {
57+
plusSpan.addEventListener('click', function() {
58+
var iconNumeric = document.getElementById("icontemplate").ej2_instances[0];
59+
iconNumeric.value = iconNumeric.value + 1;
60+
iconNumeric.dataBind();
61+
});
62+
}
63+
}
64+
</script>
65+
66+
@*custom code start*@
67+
<style>
68+
.content-wrapper {
69+
width: 35%;
70+
margin: 0 auto;
71+
min-width: 250px;
72+
}
73+
.custom-margin {
74+
margin: 25px 0;
75+
}
76+
.e-icons.e-search {
77+
background-color: rgba(0, 0, 0, 0) !important;
78+
}
79+
.e-numeric.e-control-wrapper.e-input-group .e-input-group-icon {
80+
background-color: rgba(0,0,0,0) !important;
81+
}
82+
.bootstrap5\.3 .e-icontemplate .e-prepend-template,
83+
.bootstrap5\.3 .e-prependtemplate .e-prepend-template,
84+
.bootstrap5\.3-dark .e-icontemplate .e-prepend-template,
85+
.bootstrap5\.3-dark .e-prependtemplate .e-prepend-template,
86+
.tailwind3 .e-icontemplate .e-prepend-template,
87+
.tailwind3 .e-prependtemplate .e-prepend-template,
88+
.tailwind3-dark .e-icontemplate .e-prepend-template,
89+
.tailwind3-dark .e-prependtemplate .e-prepend-template {
90+
padding-right: 0 !important;
91+
}
92+
.fluent2 .e-icontemplate .e-prepend-template,
93+
.fluent2-dark .e-icontemplate .e-prepend-template,
94+
.fluent2-highcontrast .e-icontemplate .e-prepend-template,
95+
.fluent2 .e-prependtemplate .e-prepend-template,
96+
.fluent2-dark .e-prependtemplate .e-prepend-template,
97+
.fluent2-highcontrast .e-prependtemplate .e-prepend-template {
98+
padding-left: 8px !important;
99+
}
100+
.fluent2 .e-appendtemplate .e-numerictextbox,
101+
.fluent2-dark .e-appendtemplate .e-numerictextbox,
102+
.fluent2-highcontrast .e-appendtemplate .e-numerictextbox {
103+
padding-left: 8px !important;
104+
}
105+
.material3 .e-icontemplate .e-prepend-template,
106+
.material3-dark .e-icontemplate .e-prepend-template,
107+
.material3 .e-prependtemplate .e-prepend-template,
108+
.material3-dark .e-prependtemplate .e-prepend-template {
109+
padding-left: 0 !important;
110+
}
111+
.e-bigger.bootstrap5\.3 .row.custom-margin .e-append-template,
112+
.e-bigger.bootstrap5\.3-dark .row.custom-margin .e-append-template {
113+
padding: 7px !important;
114+
}
115+
.e-bigger.fluent2 .row.custom-margin .e-append-template,
116+
.e-bigger.fluent2-dark .row.custom-margin .e-append-template,
117+
.e-bigger.fluent2-highcontrast .row.custom-margin .e-append-template,
118+
.e-bigger.tailwind3 .row.custom-margin .e-append-template,
119+
.e-bigger.tailwind3-dark .row.custom-margin .e-append-template {
120+
padding: 8px !important;
121+
}
122+
.e-icontemplate .e-icons.e-reset,
123+
.e-icontemplate .e-icons.e-horizontal-line,
124+
.e-icontemplate .e-icons.e-plus {
125+
cursor: pointer;
126+
}
127+
</style>
128+
@*custom code end*@

0 commit comments

Comments
 (0)