|
[index.razor]
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<SfTextBox></SfTextBox>
<button @onclick="onClick">Click to get the textbox in the page</button>
@code{
[Inject]
protected IJSRuntime JsRuntime { get; set; }
public async Task onClick()
{
await JsRuntime.InvokeVoidAsync("onCreate", "");
}
} |
|
[daterange.js]
window.onCreate = (id) => {
var textboxCount = document.querySelectorAll(".e-textbox").length;
var textboxItem = document.querySelectorAll(".e-textbox");
console.log("All rendered TextBox element", textboxItem);
console.log("Rendered Textbox count", textboxCount);
} |
|
@using Syncfusion.Blazor.Inputs
<SfTextBox CssClass="@cssClass" Value="@val"></SfTextBox>
<SfTextBox CssClass="@cssClass" Value="@val"></SfTextBox>
<SfTextBox CssClass="@cssClass" Value="@val"></SfTextBox>
<SfTextBox CssClass="@cssClass" Value="@val"></SfTextBox>
@code{
public string val { get; set; } = "First Name";
public string cssClass { get; set; } = "e-custom";
} |