Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions docs/angular_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ DHTMLX Spreadsheet is compatible with **Angular**. We have prepared code example
Before you start to create a new project, install [**Angular CLI**](https://angular.dev/tools/cli) and [**Node.js**](https://nodejs.org/en/).
:::

Create a new **my-angular-spreadsheet-app** project using Angular CLI. Run the following command for this purpose:
Create a new *my-angular-spreadsheet-app* project using Angular CLI. Run the following command:

~~~json
ng new my-angular-spreadsheet-app
~~~

:::note
If you want to follow this guide, disable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) when creating new Angular app!
If you want to follow this guide, disable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) when creating a new Angular app.
:::

The command above installs all the necessary tools, so you don't need to run any additional commands.
Expand All @@ -45,25 +45,25 @@ yarn
yarn start
~~~

The app should run on a localhost (for instance `http://localhost:3000`).
The app should run on localhost (for instance `http://localhost:3000`).

## Creating Spreadsheet

Now you should get the DHTMLX Spreadsheet source code. First of all, stop the app and proceed with installing the Spreadsheet package.
Now you should get the DHTMLX Spreadsheet source code. First, stop the app and install the Spreadsheet package.

### Step 1. Package installation

Download the [**trial Spreadsheet package**](how_to_start.md#installing-spreadsheet-via-npm-or-yarn) and follow steps mentioned in the README file. Note that trial Spreadsheet is available 30 days only.
Download the [**trial Spreadsheet package**](how_to_start.md#installing-spreadsheet-via-npm-or-yarn) and follow the steps in the README file. Note that trial Spreadsheet is available for 30 days only.

### Step 2. Component creation

Now you need to create an Angular component, to add Spreadsheet into the application. Create the **spreadsheet** folder in the **src/app/** directory, add a new file into it and name it **spreadsheet.component.ts**. Then complete the steps described below.
Now you need to create an Angular component to add Spreadsheet into the application. Create the *spreadsheet* folder in the *src/app/* directory, add a new file into it and name it *spreadsheet.component.ts*. Then complete the steps described below.

#### Importing source files

Open the file and import Spreadsheet source files. Note that:

- if you use PRO version and install the Spreadsheet package from a local folder, the imported path looks like this:
- if you use the PRO version and install the Spreadsheet package from a local folder, the imported path looks like this:

~~~jsx
import { Spreadsheet } from 'dhx-spreadsheet-package';
Expand Down Expand Up @@ -111,7 +111,7 @@ export class SpreadsheetComponent implements OnInit, OnDestroy {

#### Adding styles

To display Spreadsheet correctly, you need to provide the corresponding styles. For this purpose, you can create the **spreadsheet.component.css** file in the **src/app/spreadsheet/** directory and specify important styles for Spreadsheet and its container:
To display Spreadsheet correctly, you need to provide the corresponding styles. For this purpose, you can create the *spreadsheet.component.css* file in the *src/app/spreadsheet/* directory and specify important styles for Spreadsheet and its container:

~~~css title="spreadsheet.component.css"
/* import Spreadsheet styles */
Expand All @@ -133,7 +133,7 @@ body {

#### Loading data

To add data into Spreadsheet, you need to provide a data set. You can create the **data.ts** file in the **src/app/spreadsheet/** directory and add some data into it:
To add data into Spreadsheet, you need to provide a data set. You can create the *data.ts* file in the *src/app/spreadsheet/* directory and add some data into it:

~~~jsx title="data.ts"
export function getData(): any {
Expand Down Expand Up @@ -178,7 +178,7 @@ export function getData(): any {
}
~~~

Then open the ***spreadsheet.component.ts*** file. Import the file with data and apply it using the [`parse()`](api/spreadsheet_parse_method.md) method within the `ngOnInit()` method, as shown below.
Then open the *spreadsheet.component.ts* file. Import the file with data and apply it using the [`parse()`](api/spreadsheet_parse_method.md) method within the `ngOnInit()` method, as shown below.

~~~jsx {2,18,21} title="spreadsheet.component.ts"
import { Spreadsheet } from "@dhx/trial-spreadsheet";
Expand Down Expand Up @@ -210,13 +210,13 @@ export class SpreadsheetComponent implements OnInit, OnDestroy {
}
~~~

Now the Spreadsheet component is ready to use. When the element will be added to the page, it will initialize the Spreadsheet with data. You can provide necessary configuration settings as well. Visit our [Spreadsheet API docs](api/overview/events_overview.md) to check the full list of available properties.
Now the Spreadsheet component is ready to use. When the element is added to the page, it initializes Spreadsheet with data. You can provide necessary configuration settings as well. Visit our [Spreadsheet API docs](api/overview/events_overview.md) to check the full list of available properties.

#### Handling events

When a user makes some action in the Spreadsheet, it invokes an event. You can use these events to detect the action and run the desired code for it. See the [full list of events](api/overview/events_overview.md).
When a user performs an action in Spreadsheet, the widget invokes an event. You can use these events to detect the action and run the desired code for it. See the [full list of events](api/overview/events_overview.md).

Open the **spreadsheet.component.ts** file and complete the `ngOnInit()` method as in:
Open the *spreadsheet.component.ts* file and complete the `ngOnInit()` method as in:

~~~jsx {5-8} title="spreadsheet.component.ts"
// ...
Expand All @@ -236,7 +236,7 @@ ngOnDestroy() {

### Step 3. Adding Spreadsheet into the app

To add the ***SpreadsheetComponent*** component into the app, open the ***src/app/app.component.ts*** file and replace the default code with the following one:
To add the `SpreadsheetComponent` component into the app, open the *src/app/app.component.ts* file and replace the default code with the following one:

~~~jsx {5} title="app.component.ts"
import { Component } from "@angular/core";
Expand All @@ -250,7 +250,7 @@ export class AppComponent {
}
~~~

Then create the ***app.module.ts*** file in the ***src/app/*** directory and specify the *SpreadsheetComponent* as shown below:
Then create the *app.module.ts* file in the *src/app/* directory and specify the `SpreadsheetComponent` as shown below:

~~~jsx {4-5,8} title="app.module.ts"
import { NgModule } from "@angular/core";
Expand All @@ -267,7 +267,7 @@ import { SpreadsheetComponent } from "./spreadsheet/spreadsheet.component";
export class AppModule {}
~~~

The last step is to open the ***src/main.ts*** file and replace the existing code with the following one:
The last step is to open the *src/main.ts* file and replace the existing code with the following one:

~~~jsx title="main.ts"
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
Expand All @@ -281,4 +281,4 @@ After that, you can start the app to see Spreadsheet loaded with data on a page.

![DHTMLX Spreadsheet initialized with sample data in an Angular application](/img/integrations/trial_spreadsheet.png)

Now you know how to integrate DHTMLX Spreadsheet with Angular. You can customize the code according to your specific requirements. The final example you can find on [**GitHub**](https://github.com/DHTMLX/angular-spreadsheet-demo).
Now you know how to integrate DHTMLX Spreadsheet with Angular. You can customize the code according to your specific requirements. You can find the final example on [**GitHub**](https://github.com/DHTMLX/angular-spreadsheet-demo).
6 changes: 3 additions & 3 deletions docs/api/eventsbus_detach_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: You can learn about the detach events bus method in the documentati

### Description

@short: Detaches a handler from an event (which was attached before by the on() method)
@short: Detaches a handler from an event (previously attached with the `on()` method)

### Usage

Expand All @@ -18,7 +18,7 @@ detach(name: string): void;

### Parameters

- `name` - (required) the name of event to detach
- `name` - (required) the name of the event to detach

### Example

Expand All @@ -36,7 +36,7 @@ spreadsheet.events.detach("StyleChange");
~~~

:::info
By default **detach()** removes all event handlers from the target event. You can detach particular event handlers by using the context marker.
By default, `detach()` removes all event handlers from the target event. You can detach particular event handlers using a context marker.
:::

~~~jsx
Expand Down
2 changes: 1 addition & 1 deletion docs/api/eventsbus_fire_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fire(name: string, arguments: array): boolean;

### Returns

The method returns `false`, if some of the event handlers return `false`. Otherwise, `true`
The method returns `false` if some of the event handlers return `false`. Otherwise, `true`

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/eventsbus_on_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spreadsheet.events.on("StyleChange", function(id){
:::info
See the full list of the Spreadsheet events [here](api/api_overview.md#spreadsheet-events).

You can attach several handlers to the same event and all of them will be executed. If some of handlers return *false*, the related operations will be blocked. Event handlers are processed in the same order that they are attached.
You can attach several handlers to the same event and all of them are executed. If some handlers return `false`, the related operations are blocked. Event handlers are processed in the same order that they are attached.
:::

**Related articles:** [Event Handling](handling_events.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/api/export_xlsx_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ spreadsheet.export.xlsx("MyData");
~~~

:::note
Please note that the component supports export to Excel files with the **.xlsx** extension only.
Note that the component supports export to Excel files with the `.xlsx` extension only.
:::

:::info
DHTMLX Spreadsheet uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) for export of data to Excel. [Check the details](loading_data.md#exporting-data).
DHTMLX Spreadsheet uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to export data to Excel. [Check the details](loading_data.md#exporting-data).
:::

**Related articles:** [Data loading and export](loading_data.md)
Expand Down
10 changes: 5 additions & 5 deletions docs/api/overview/actions_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ description: You can check an Actions overview of the DHTMLX JavaScript Spreadsh

# Actions overview

This section is dedicated to a new conception of interaction with Spreadsheet events.
This section describes a new approach to interacting with Spreadsheet events.

Starting from v4.3, DHTMLX Spreadsheet includes a pair of the [beforeAction](api/spreadsheet_beforeaction_event.md)/[afterAction](api/spreadsheet_afteraction_event.md) events that are intended to make your code simple and concise. They will fire right before an action is executed and indicate which exactly action has been performed.
Starting from v4.3, DHTMLX Spreadsheet includes a pair of [`beforeAction`](api/spreadsheet_beforeaction_event.md)/[`afterAction`](api/spreadsheet_afteraction_event.md) events that make your code simpler and more concise. They fire right before an action is executed and indicate exactly which action was performed.

~~~jsx
spreadsheet.events.on("beforeAction", (actionName, config) => {
Expand All @@ -29,9 +29,9 @@ spreadsheet.events.on("afterAction", (actionName, config) => {

[The full list of the available actions is given below.](#list-of-actions)

>It means, that you don't have to constantly add sets of paired [**before-** and **after-**](api/overview/events_overview.md) events anymore to track and handle the actions which you execute when changing something in the spreadsheet.
>This means that you no longer have to add sets of paired [**before-** and **after-**](api/overview/events_overview.md) events to track and handle the actions you execute when changing something in the spreadsheet.

>But if needed you can use an **old approach** because all the existing events will continue work as before:
>But if needed, you can use the **old approach**, because all the existing events continue to work as before:
~~~jsx
spreadsheet.events.on("afterColumnAdd", function(cell){
console.log("A new column is added", cell);
Expand Down Expand Up @@ -61,7 +61,7 @@ spreadsheet.events.on("beforeColumnAdd", function(cell){
| **deleteSheet** | The action is executed when removing a sheet |
| **filter** | The action is executed when filtering data in a sheet |
| **fitColumn** | The action is executed when auto-fitting the width of the column |
| **groupAction** | The action is executed when selecting a range of cells and applying to them some actions (for instance, change the style or format of cells, lock/unlock the cells, clear cells' value or styles, etc.) |
| **groupAction** | The action is executed when selecting a range of cells and applying to them some actions (for instance, change the style or format of cells, lock/unlock the cells, or clear cells' value or styles) |
| **insertLink** | The action is executed when inserting a hyperlink in a cell |
| **lockCell** | The action is executed when locking/unlocking a cell |
| **merge** | The action is executed when merging a range of cells |
Expand Down
2 changes: 1 addition & 1 deletion docs/api/selection_getfocusedcell_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ getFocusedCell(): string;

### Returns

The method returns an id of a focused cell
The method returns the id of the focused cell

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/selection_getselectedcell_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ getSelectedCell(): string;

### Returns

The method returns an id(s) or a range of selected cell(s)
The method returns the id(s) or a range of selected cell(s)

### Example

Expand Down
8 changes: 4 additions & 4 deletions docs/api/sheetmanager_add_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ description: You can learn about the add method of the Sheet Manager in the docu

@short: Adds a new empty sheet to the spreadsheet and returns the unique identifier of the newly created sheet

If no name is provided, a default name will be generated automatically (e.g. "Sheet 2", "Sheet 3", etc.).
If no name is provided, a default name is generated automatically (for example, "Sheet 2" or "Sheet 3").

:::info
To apply this method, you need to enable the [multiSheets](api/spreadsheet_multisheets_config.md) configuration option.
To apply this method, you need to enable the [`multiSheets`](api/spreadsheet_multisheets_config.md) configuration option.
:::

### Usage
Expand All @@ -24,11 +24,11 @@ add: (name?: string) => Id;

### Parameters

- `name` - (*string*) optional, the displayed name for the new sheet tab. If omitted, a default name is assigned.
- `name` - (`string`) optional, the displayed name for the new sheet tab. If omitted, a default name is assigned.

### Returns

- `Id` - (*string | number*) the unique identifier of the newly created sheet.
- `Id` - (`string | number`) the unique identifier of the newly created sheet.

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/sheetmanager_clear_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clear: (id?: Id) => void;

### Parameters

- `id` - (*string | number*) optional, the unique identifier of the sheet to clear. If omitted, the currently active sheet is cleared.
- `id` - (`string | number`) optional, the unique identifier of the sheet to clear. If omitted, the currently active sheet is cleared.

### Example

Expand Down
4 changes: 2 additions & 2 deletions docs/api/sheetmanager_get_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ get: (id: Id) => ISheet;

### Parameters

- `id` - (*string | number*) required, the unique identifier of the sheet to retrieve.
- `id` - (`string | number`) required, the unique identifier of the sheet to retrieve.

### Returns

- `ISheet` - (*object*) the sheet object matching the given id.
- `ISheet` - (`object`) the sheet object matching the given id.

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/sheetmanager_getactive_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ getActive: () => ISheet;

### Returns

- `ISheet` - (*object*) the currently active sheet object with the `id` and `name` properties.
- `ISheet` - (`object`) the currently active sheet object with the `id` and `name` properties.

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/sheetmanager_getall_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ getAll: () => ISheet[];

### Returns

- `ISheet[]` - (*array*) an array of sheet objects.
- `ISheet[]` - (`array`) an array of sheet objects.

### Example

Expand Down
8 changes: 4 additions & 4 deletions docs/api/sheetmanager_remove_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ description: You can learn about the remove method of the Sheet Manager in the d

@short: Removes a sheet from the spreadsheet by its identifier

If the removed sheet was active, the spreadsheet will automatically switch to another available sheet.
If the removed sheet was active, the spreadsheet automatically switches to another available sheet.

:::info
To apply this method, you need to enable the [multiSheets](api/spreadsheet_multisheets_config.md) configuration option.
To apply this method, you need to enable the [`multiSheets`](api/spreadsheet_multisheets_config.md) configuration option.

Also note, that a sheet won't be deleted if the number of sheets in the spreadsheet is less than 2.
Also note that a sheet is not deleted if the spreadsheet has fewer than 2 sheets.
:::

### Usage
Expand All @@ -26,7 +26,7 @@ remove: (id: Id) => void;

### Parameters

- `id` - (*string | number*) required, the unique identifier of the sheet to remove.
- `id` - (`string | number`) required, the unique identifier of the sheet to remove.

### Example

Expand Down
4 changes: 2 additions & 2 deletions docs/api/sheetmanager_setactive_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: You can learn about the setActive method of the Sheet Manager in th

@short: Switches the active (visible) sheet to the one specified by its identifier

The spreadsheet UI will re-render to display the target sheet's contents.
The spreadsheet UI re-renders to display the target sheet's contents.

### Usage

Expand All @@ -20,7 +20,7 @@ setActive: (id: Id) => void;

### Parameters

- `id` - (*string | number*) required, the unique identifier of the sheet to activate.
- `id` - (`string | number`) required, the unique identifier of the sheet to activate.

### Example

Expand Down
6 changes: 3 additions & 3 deletions docs/api/spreadsheet_addformula_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: You can learn about the addFormula method in the documentation of t

@short: Registers a custom formula function that can be used in cell formulas

Once registered, the formula is available in any cell by its uppercase name (e.g. =MYFUNC(A1, B2)).
Once registered, the formula is available in any cell by its uppercase name (for example, `=MYFUNC(A1, B2)`).

### Usage

Expand All @@ -24,8 +24,8 @@ addFormula: (name: string, handler: mathFunction) => void;

### Parameters

- `name` - (*string*) required, the formula name (case-insensitive, stored as uppercase)
- `handler` - (*function*) required, a callback function that processes the input arguments (strings, numbers, booleans, or arrays of these) and returns a single value
- `name` - (`string`) required, the formula name (case-insensitive, stored as uppercase)
- `handler` - (`function`) required, a callback function that processes the input arguments (strings, numbers, booleans, or arrays of these) and returns a single value

:::note
The `handler` callback function must be synchronous. Using `Promise` or `fetch` inside the function is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/spreadsheet_afterclear_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: You can learn about the afterClear event in the documentation of th
# afterClear

:::caution
The **afterClear** event has been deprecated in v4.3. The event will continue work, but you'd better apply a new approach:
The `afterClear` event was deprecated in v4.3. It still works, but you should apply the new approach:

~~~jsx
spreadsheet.events.on("afterAction", (actionName, config) => {
Expand Down
Loading