Class GridWidgetBase
- Namespace
- Dynamicweb.Dashboard.Widgets
- Assembly
- Dynamicweb.Core.dll
The class DashboardWidget provides base list dashboard widget
- Inheritance
-
Grid
Widget Base
- Implements
- Inherited Members
Examples
using Dynamicweb.Dashboard.Widgets;
using Dynamicweb.Extensibility.AddIns;
using System.Collections.Generic;
namespace Dynamicweb.Dashboard.Examples;
[AddInName("Simple grid")]
[AddInDescription("Total cities population")]
[AddInIcon(Core.UI.Icons.KnownIcon.PieChart)]
public sealed class SimpleGridWidget : GridWidgetBase
{
public SimpleGridWidget()
{
Title = "Total cities population";
}
public override IEnumerable<GridWidgetColumn> GetColumns() =>
[
new("Name", "Population")
];
public override List<Dictionary<string, object>> GetItems(IDashboard dashboard, string path) => new()
{
new()
{
["Name"] = "London",
["Population"] = 500000
},
new()
{
["Name"] = "New York",
["Population"] = 200000
},
new()
{
["Name"] = "Copenhagen",
["Population"] = 300000
},
new()
{
["Name"] = "Berlin",
["Population"] = 200000
},
new()
{
["Name"] = "Madrid",
["Population"] = 250000
},
new()
{
["Name"] = "Pekin",
["Population"] = 150000000
}
};
}
Constructors
GridWidgetBase()
The list widget default constructor
Methods
GetColumns()
Gets grid columns
Returns
GetItems(IDashboard, string)
Gets grid items
Parameters
dashboard
IDashboardThe dashboard
path
stringThe request path