Hi,
I have a grid with a spinner control. That works fine. However there is another spinner on the page which seems to be linked to DropdownLists
On checking the page source for the class "e-spinner-inner" I find the spinner control but also a instance after each SfDropDownList control.
Any ideas how to prevent this?
OK, I understand but doesn't look great. Would it be possible to use a different class or have an option to disable?
|
@using Syncfusion.Blazor.DropDowns
@using Microsoft.JSInterop;
<SfDropDownList TValue="string" ID=”spinDisable” TItem="Games" Placeholder="Select a game" DataSource="@LocalData">
<DropDownListEvents TItem="Games" TValue="string" Created="@OnCreate"></DropDownListEvents>
<DropDownListFieldSettings Value="ID" Text="Text"></DropDownListFieldSettings>
</SfDropDownList>
@code {
[Inject]
IJSRuntime jsRuntime { get; set; }
public class Games
{
public string ID { get; set; }
public string Text { get; set; }
}
List<Games> LocalData = new List<Games> {
new Games() { ID= "Game1", Text= "American Football" },
new Games() { ID= "Game2", Text= "Badminton" },
new Games() { ID= "Game3", Text= "Basketball" },
new Games() { ID= "Game4", Text= "Cricket" },
new Games() { ID= "Game5", Text= "Football" },
new Games() { ID= "Game6", Text= "Golf" },
new Games() { ID= "Game7", Text= "Hockey" },
new Games() { ID= "Game8", Text= "Rugby"},
new Games() { ID= "Game9", Text= "Snooker" },
new Games() { ID= "Game10", Text= "Tennis"},
};
private async void OnCreate()
{
await jsRuntime.InvokeAsync<string>("DropDowmSpinner.disabled");
}
} |
|
<script>
window.DropDowmSpinner = {
disabled: function (args) {
if (document.querySelector(''#spinDisable ~ .e-ddl-icon .e-spinner-pane ')) {
document.querySelector(''#spinDisable ~ .e-ddl-icon .e-spinner-pane').classList.add('e-disabled');
}
}
}
</script> |
Unfortunately I can't get that to work with the code you have provided. It fires (added an alert to the _host script) but there are still spinners.
|
<script>
window.DropDownSpinner = {
disabled: function (args) {
if (document.querySelector('#spinDisable ~ .e-ddl-icon .e-spinner-pane')) {
document.querySelector('#spinDisable ~ .e-ddl-icon .e-spinner-pane').style.display = "none";
document.querySelector('#spinDisable ~ .e-ddl-icon .e-spinner-pane').classList.add('e-disabled');
}
}
} </script> |