ASP.NET Core MVC Controls | ComponentOne
In This Topic
    PropertyGroupDescription Class
    In This Topic
    File
    wijmo.js
    Module
    wijmo.collections
    Base Class
    GroupDescription

    Describes the grouping of items using a property name as the criterion.

    For example, the code below causes a CollectionView to group items by the value of their 'country' property:

    var cv = new wijmo.collections.CollectionView(items);
    var gd = new wijmo.collections.PropertyGroupDescription('country');
    cv.groupDescriptions.push(gd);
    

    You may also specify a callback function that generates the group name. For example, the code below causes a CollectionView to group items by the first letter of the value of their 'country' property:

    var cv = new wijmo.collections.CollectionView(items);
    var gd = new wijmo.collections.PropertyGroupDescription('country', 
      function(item, propName) {
        return item[propName][0]; // return country's initial
    });
    cv.groupDescriptions.push(gd);
    

    Constructor

    Properties

    Methods

    Constructor

    constructor

    constructor(property: string, converter?: IGroupConverter): PropertyGroupDescription
    

    Initializes a new instance of the PropertyGroupDescription class.

    Parameters
    • property: string

      The name of the property that specifies which group an item belongs to.

    • converter: IGroupConverter
    Optional

    A callback function that takes an item and a property name and returns the group name. If not specified, the group name is the property value for the item.

    Returns
    PropertyGroupDescription

    Properties

    propertyName

    Gets the name of the property that is used to determine which group an item belongs to.

    Type
    string

    Methods

    groupNameFromItem

    groupNameFromItem(item: any, level: number): any
    

    Returns the group name for the given item.

    Parameters
    • item: any

      The item to get group name for.

    • level: number

      The zero-based group level index.

    Returns
    any

    namesMatch

    namesMatch(groupName: any, itemName: any): boolean
    

    Returns a value that indicates whether the group name and the item name match (which implies that the item belongs to the group).

    Parameters
    • groupName: any

      The name of the group.

    • itemName: any

      The name of the item.

    Returns
    boolean