Skip to main content

UnitList

Namespace: Wisej.Web.Ext.Webix

Assembly: Wisej.Web.Ext.Webix (4.1.0.0)

UnitList presents data in groups derived from initial non-hierarchical dataset. Data items are sorted and then united by common values.

public class UnitList : wxBase

Constructors​

Instance member UnitList()​

Constructs a new instance of the UnitList class.

Example:

The following example creates a list that groups the customers by city. The Webix option uniteBy requires a JavaScript function, which is declared in WidgetFunctions and referenced by name in the options.

var list = new UnitList();
list.WidgetFunctions = new[]
{
new wxBase.WidgetFunction { Name = "byCity", Source = "return obj.city;" }
};
list.Options.uniteBy = "(obj)=>byCity";
list.Options.template = "#name#";
list.Options.data = new[]
{
new { id = 1, name = "Anna", city = "Rome" },
new { id = 2, name = "Marco", city = "Rome" },
new { id = 3, name = "Julie", city = "Paris" }
};
list.Size = new Size(300, 400);
this.Controls.Add(list);

Instance member UnitList(options)​

Constructs a new instance of the UnitList class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example creates a list that groups the movies by the first letter of the title.

var list = new UnitList(new
{
uniteBy = "(obj)=>firstLetter",
template = "#title#",
data = new[]
{
new { id = 1, title = "Alien" },
new { id = 2, title = "Amadeus" },
new { id = 3, title = "Blade Runner" }
}
});
list.WidgetFunctions = new[]
{
new wxBase.WidgetFunction { Name = "firstLetter", Source = "return obj.title.substr(0, 1);" }
};
list.Size = new Size(300, 400);
this.Controls.Add(list);

Implements​