Skip to content

Commit

Permalink
[update] properties and internal methods updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tbshag2 committed Apr 29, 2024
1 parent 3045819 commit c6380a7
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/api/config/data-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const data = [

### Example

~~~jsx {}
~~~jsx {3-29}
const pivotWidget = new pivot.Pivot("#pivot", {
fields,
data: [
Expand Down
2 changes: 1 addition & 1 deletion docs/api/config/methods-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ There is no limit to the number of sub-properties that can be defined in the met

The example below shows how to calculate the average value of an array. The function takes an array of numbers (vals) as an input, calculates the sum of these numbers using the **reduce** method, and then divides the sum by the length of the array to obtain the average value.

~~~jsx
~~~jsx {1-6,17}
const methods = {
average: (vals) => {
const sum = vals.reduce((acc, v) => acc + v, 0);
Expand Down
2 changes: 1 addition & 1 deletion docs/api/config/readonly-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const pivotWidget = new pivot.Pivot("#pivot", {
],
},

readonly: true;
readonly: true

});
~~~
7 changes: 3 additions & 4 deletions docs/api/config/tableconfig-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ const widget = new pivot.Pivot("#pivot", {
}
});

widget.api.intercept("render-table", (ev) => {
ev.config.data.forEach((row) => (row.open = false));
})
widget.api.intercept("render-table", (ev) => {
ev.config.data.forEach((row) => (row.open = false));
})

let mode = "tree";

Expand All @@ -113,7 +113,6 @@ function closeAll() {
// Reactive statement to update table shape based on mode
tableShape.tree = mode == "tree";

// Rendering buttons
const openAllButton = document.createElement('button');
openAllButton.addEventListener('click', openAll);
openAllButton.textContent = 'Open all';
Expand Down
2 changes: 1 addition & 1 deletion docs/api/config/tableshape-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tableShape?: {

## Example

~~~jsx
~~~jsx {2-8}
const widget = new pivot.Pivot("#pivot", {
tableShape: {
tree: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/getreactivestate-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The method returns an object with the following parameters:

### Example

~~~jsx {}
~~~jsx {6-14}
// create Pivot
const table = new pivot.Pivot("#root", {
...
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/getstate-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The method returns an object with the following parameters:

### Example

~~~jsx {}
~~~jsx {6-7}
// create Pivot
const table = new pivot.Pivot("#root", {
...
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/getstores-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The method returns an object with the **DataStore** parameters:

### Example

~~~jsx {}
~~~jsx {6-7}
// create Pivot
const table = new pivot.Pivot("#root", {
...
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/intercept-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Use the `api.on()` method if you want to listen to the actions without modifying

### Example

~~~jsx {}
~~~jsx {6-9}
// create Pivot
const table = new pivot.Pivot("#root", {
...
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/on-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Use the `api.on()` method if you want to listen to the actions without modifying

The example below shows how to output the label of a filed for which filter was activated:

~~~jsx {}
~~~jsx {6-13}
// create Pivot
const table = new pivot.Pivot("#root", {
...
Expand Down

0 comments on commit c6380a7

Please sign in to comment.