constructor(engine: PivotEngine, binding: string, header?: string, options?: any): PivotField
Initializes a new instance of the PivotField class.
PivotEngine that owns this field.
Property that this field is bound to.
Header shown to identify this field (defaults to the binding).
JavaScript object containing initialization data for the field.
Gets or sets a value that determines whether keys should be sorted in descending order for this field.
Gets or sets a value that determines whether this field is currently being used in the view.
Setting this property to true causes the field to be added to the view's rowFields or valueFields, depending on the field's data type.
Gets or sets a value indicating whether items in this field contain HTML content rather than plain text.
Gets the key for this PivotField.
For regular fields, the key is the field's header; for CubePivotField instances, the key is the field's binding.
Gets this field's parent field.
When you drag the same field into the Values list multiple times, copies of the field are created so you can use the same binding with different parameters. The copies keep a reference to their parent fields.
Gets or sets a function used to compare values when sorting.
If provided, the sort comparer function should take as parameters two values of any type, and should return -1, 0, or +1 to indicate whether the first value is smaller than, equal to, or greater than the second. If the sort comparer returns null, the standard built-in comparer is used.
This sortComparer property allows you to use custom comparison algorithms that in some cases result in sorting sequences that are more consistent with user's expectations than plain string comparisons.
The example below shows a typical use for the sortComparer property:
// define list of products
app.products = 'Wijmo,Aoba,Olap,Xuni'.split(',');
// sort products by position in the 'app.products' array
ng.viewDefinitionChanged.addHandler(function () {
var fld = ng.fields.getField('Product');
if (fld) {
fld.sortComparer = function (val1, val2) {
return app.products.indexOf(val1) - app.products.indexOf(val2);
}
}
});Gets or sets the PivotField used as a weight for calculating aggregates on this field.
If this property is set to null, all values are assumed to have weight one.
This property allows you to calculate weighted averages and totals. For example, if the data contains a 'Quantity' field and a 'Price' field, you could use the 'Price' field as a value field and the 'Quantity' field as a weight. The output would contain a weighted average of the data.
Gets or sets the preferred width to be used for showing this field in the user interface.
Gets or sets a value that indicates whether the content of this field should be allowed to wrap within cells.
onPropertyChanged(e: PropertyChangedEventArgs): void
Raises the propertyChanged event.
PropertyChangedEventArgs that contains the property name, old, and new values.
Occurs when the value of a property in this Range changes.
Represents a property of the items in the wijmo.olap data source.