Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,39 @@ if (selection.type === "Single") {

## Exposed Modules

### Session {#session}

The Mendix Platform exposes a `mendix/session` module for inspecting the current user session. It is available in both web and native.

For instance, `getUserId` returns the current user's GUID as a `string`.

```ts
function getUserId(): GUID;
```

---

### Parser {#parser}

The Mendix Platform exposes a `mendix/parser` module that provides locale-aware formatting and parsing of attribute values. These functions use the same locale and formatting settings of the built-in Mendix widgets. It is available in both web and native.

```ts
import { formatValue, parseValue } from "mendix/parser";
```

Both functions accept an optional configuration object:

```ts
interface FormatValueConfig {
selector?: "date" | "time" | "datetime";
datePattern?: string;
places?: number;
groups?: boolean;
}
```

For the reference of the API, you can refer to the [API documentation](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-parser/).

### Icon {#icon}

Mendix Platform exposes two versions of an `Icon` react component: `mendix/components/web/Icon` and `mendix/components/native/Icon`. Both components are useful helpers to render `WebIcon` and `NativeIcon` values respectively. They should be passed through an `icon` prop. The native `Icon` component additionally accepts `color` (`string`) and `size` (`number`) props.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ It is possible to set filtering conditions for items of a datasource. `setFilter

Some examples of builder functions are `equals`, `greaterThan`, `lessThanOrEqual` for filtering on `DateTime` or `Decimal` attributes. Functions like `startsWith`, `contains` are useful for filtering on `String` attributes. Filtering based on associations is also possible. For example, you can use `equals` with references and `contains` with reference sets.

To use the filter builders in a pluggable widget, import the individual builder functions you need directly from the "mendix/filters/builders" module path:

```ts
import { attribute, literal, equals, startsWith, and, or } from "mendix/filters/builders";
```

The following code samples show how to use filter builders and apply filtering to a data source property with three linked attributes and two linked associations:

```ts
Expand Down