Skip to content

Commit

Permalink
[update] events updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tbshag2 committed May 27, 2024
1 parent 90c534b commit eb9f797
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/api/config/config-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The `config` parameters are used to define which fields will be applied as rows
- `field` - (required) the ID of a field
- `method` - (optional) defines a method for data processing in the field; methods for the time-based data fields are available by default: year, month, day, hour, minute which group data by year/month/day/hour; here you can also add the name of a custom method ([see `predicates`](/api/config/predicates-property)) for the field of any data type
- `columns` - (optional) defines columns for the Pivot table. It's an empty array by default. It can be a single field ID or an object with the field ID and a method for data extraction; the object parameters are the following:
- `field` - (required) a field ID
- `field` - (required) the ID of a field
- `method` - (optional) defines a method for data processing (for time-based data fields).
By default, methods are available for the time-based fields (the **when** field) with the next values: year, month, day, hour, minute. Here you can also add the name of a custom method ([see `predicates`](/api/config/predicates-property)) for the field of any data type
- `values` - (optional) defines the data aggregation for the cells of the Pivot table. It's an empty array by default. Each element can be a string representing a data field ID and aggregation method or an object containing the field ID and the method for data aggregation. The object parameters are the following:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/events/add-field-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ The callback of the action takes an object with the following parameters:
- `area` - (required) the name of the area where a new field is added, which can be "rows", "columns" or "values" area
- `field` - (required) a new auto-generated field id
- `method` - (optional) defines a method for data aggregation (if not specified, a default method is set); a method can be one of the following:
- for the **values** area, it's one of the data operation types:
- it's required for the **values** area, it's one of the data operation types:
- for numbers: min, max, sum, count
- for text values: count
- for date value: min, max, count
- for the **rows** and **columns** areas and the **when** field, it's a default data predicate with one of the next values: year, month, day, hour, minute. If it's a custom predicate, the id is specified for the **predicate** property.
- it's optional for the **rows** and **columns** areas, it's a default data predicate with one of the next values: year, month, day, hour, minute. If it's a custom predicate, the id is specified for the **predicate** property.

### Example

Expand Down
1 change: 0 additions & 1 deletion docs/api/events/apply-filter-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ The callback of the action takes an object with the following parameters:

- `rule` - any filter configuration object with such parameters as below:
- `field` - (required) the field id to which filter will be applied
- `type` - (required) data type in a field (text, number, date)
- `filter` - (required) filter type:
- for text values: equal, notEqual, contains, notContains, beginsWith, notBeginsWith, endsWith, notEndsWith
- for numeric values: greater: less, greaterOrEqual, lessOrEqual, equal, notEqual, contains, notContains
Expand Down
11 changes: 4 additions & 7 deletions docs/api/events/open-filter-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,17 @@ description: You can learn about the open-filter event in the documentation of t

~~~jsx {}
"open-filter": ({
field: {}
id: string | null,
area?: "values" | "rows" | "columns"
}) => boolean | void;
~~~

### Parameters

The callback function type takes a single argument which is the `field` object with the next parameters:
The callback of the action takes the next parameters:

- `area` - the area where a field is applied (rows, columns, values)
- `field` (only for fields without predicates) - the id of a field
- `base` (only for fields with predicates) - the id of a field
- `label` - the label of a field
- `method` - the method applied to a field
- `type` - field data type
- `id` - the id of a field; if there's a single id argument with null value, the filter will be closed.

### Returns

Expand Down
22 changes: 15 additions & 7 deletions docs/api/events/render-table-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ It allows you to alter the final table configuration on the fly or prevent the r

~~~jsx {}
"render-table": ({
tableConfig: {
config: {
columns?: [],
data?: [],
data: [],
footer?: boolean,
sizes?: {},
sizes: {},
split?: {
left?: number,
},
Expand All @@ -32,9 +32,17 @@ It allows you to alter the final table configuration on the fly or prevent the r

### Parameters

The callback of the action takes the `tableConfig` object with the following parameters:

- `columns` - (optional) columns array
The callback of the action takes the `config` object with the following parameters:

- `columns` - (optional) columns array with the next parameters for each object:
- `id` (number) - (optional) the id of a column
- `header`- (optional) an object with header settings:
- `text` (string) - (optional) a header label
- `rowspan` (number) - (optional) the number of rows a header should span
- `colspan` (number) - (optional) the number of columns a header should span
- `footer` - (optional) a header label or an object with footer settings which are the same as the header settings
- `field` - (optional) it's a string which is the id of a field
- `template` - (optional) the template that is defined via the [`tableShape`](/api/config/tableshape-property) property
- `data` - (optional) an array of objects with data for the table; each object represents a row
- `footer` - (optional) if it's set to **true**, the table footer is displayed at the bottom of the table; it's set to **false** and invisible by default
- `sizes` - (optional) an object with table sizes settings, namely, colWidth, footerHeight, headerHeight, rowHeight
Expand All @@ -43,7 +51,7 @@ The callback of the action takes the `tableConfig` object with the following par
- `cellStyle` - (optional) an object where each key is the field id and the value is a function that returns a string. All columns based on the specified field will have the related template applied.

### Returns

The callback may return boolean or void.
If the event handler returns **false**, it will block the operation in question. In this case, it will prevent the rendering of the table.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/events/update-config-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The callback of the action takes an object with the [`config`](/api/properties/c
- for numeric values: min, max, sum, count
- for text values: count
- for date value: min, max, count
Sum - sums all the values of the selected data property and displays the sum
Sum - sums all the values of the selected data property and displays the sum
Min - finds and displays the minimum value of the selected data property
Max - finds and displays the maximum value of the selected data property
Count - looks for all occurrences of the selected data property and displays their number; set by default for each newly added field
Expand Down

0 comments on commit eb9f797

Please sign in to comment.