<SfNumericTextBox TValue="double?" CssClass="e-custom-spin"></SfNumericTextBox>
<style> .e-custom-spin .e-input-group .e-input-group-icon + .e-custom-spin .e-input-group-icon,
.e-custom-spin.e-input-group.e-control-wrapper .e-input-group-icon + .e-input-group-icon {
/*To customize the spin up button in the position of spin down button since the order is changed*/
border-left: 1px solid #ced4da;
border-radius: 0px;
}
.e-custom-spin .e-input-group-icon.e-spin-down {
/*To change the order of flex*/
order: 1;
/*To apply border radius to match with input container since the order is changed*/
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
</style>
|
|
Is it possible to do the alternative layout as shown by the op?
<SfNumericTextBox Width="300px" ID="Numeric" TValue="int?" CssClass="e-custom">
<NumericTextBoxEvents TValue="int?" Created="onCreate"></NumericTextBoxEvents>
</SfNumericTextBox>
@code{
[Inject]
protected IJSRuntime JsRuntime { get; set; }
public async Task onCreate()
{
await JsRuntime.InvokeVoidAsync("create", "Numeric");
}
}
<style>
.e-input-group-icon {
display:none !important;
}
span.e-spin-up:before {
content: "\e721";
font-family: e-icons;
font-size: 10px;
}
span.e-spin-down:before {
content: "\e744";
font-family: e-icons;
font-size: 10px;
}
.e-spin-up {
display: grid;
height: 0px;
margin-top: 3px;
}
.e-spin-down {
display: grid;
width: 0px;
margin: auto;
margin-bottom: 5px;
}
.e-spin-up:hover {
background: none;
}
</style> |
window.create = (id) => {
// Create the span element for insert phone icon
var spindown = document.createElement("span");
// Add the phone icon class to the span element
spindown.setAttribute("class", "e-spin-down");
spindown.addEventListener("mousedown", (e) => {
})
var spinup = document.createElement("span");
// Add the phone icon class to the span element
spinup.setAttribute("class", "e-spin-up");
spinup.addEventListener("mousedown", (e) => {
})
// append the span element after the input wrapper
document.getElementsByClassName('e-control-container')[0].insertAdjacentElement('beforeend', spindown);
document.getElementsByClassName('e-control-container')[0].insertAdjacentElement('beforeend', spinup);
}; |