Loading Animation in ASP.NET MVC Tree Grid Component
21 Dec 20221 minute to read
The Tree Grid displays a loading indicator while the data is being fetched and bound to the tree grid during initial rendering, refreshing, and after performing any tree grid actions like sorting, filtering, and more.
The tree grid supports two indicator types, which can be enabled by setting the loadingIndicator.indicatorType
property to Spinner or Shimmer. The default value of the indicator type is Spinner.
In the following sample, the Shimmer indicator is displayed while the tree grid is loading and refreshing when using the remote data.
@Html.EJS().TreeGrid("RemoteData").DataSource(dataManager => dataManager.Url("https://services.syncfusion.com/aspnet/production/api/SelfReferenceData").Adaptor("WebApiAdaptor").CrossDomain(true)).Columns(col =>
{
col.Field("TaskID").HeaderText("Task ID").Width(120).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("TaskName").HeaderText("Task Name").Width(240).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Left).Add();
col.Field("StartDate").HeaderText("Start Date").Format("yMd").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width(140).Add();
col.Field("Duration").HeaderText("Duration").Width(130).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("Progress").HeaderText("Progress").Width(130).Add();
}).HasChildMapping("isParent").Height(400).IdMapping("TaskID").ParentIdMapping("ParentItem").AllowPaging().AllowSorting().TreeColumnIndex(1).PageSettings(page=>page.PageCount(3)).LoadingIndicator(l => { l.IndicatorType(Syncfusion.EJ2.Grids.IndicatorType.Shimmer); }).Render()
public ActionResult LoadingAnimation()
{
return View();
}
You can refer to our
ASP.NET MVC Tree Grid
feature tour page for its groundbreaking feature representations. You can also explore ourASP.NET MVC Tree Grid example
to knows how to present and manipulate data.