A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.telerik.com/kendo-react-ui/components/grid/rsc-mode/server-actions below:

React Data Grid RSC Mode Server Actions

New to KendoReact? Start a free 30-day trial RSC Mode Server Actions

Premium

The RSC architecture introduces server actions, which are seamlessly integrated in the server mode of the KendoReact Grid.

Server-actions compatibility allows passing functions to the component's callbacks, such as onDataStateChange or onItemChange, enabling the execution of custom server-side logic.

Available Server Actions

In the server mode of the Grid, the events fall into two categories:

  1. Data state change related events:
  2. Grid state operation related events:
Server Actions Configuration

To use event handlers on a server page, you can use the same setup as you would for a Grid on a client page. The key differences are:

Client event arguments such as nativeEvent, syntheticEvent, target, targetEvent, and focusElement cannot be serialized to the server and will always be undefined.

Here is an example of a server action managing the Grid’s data state:

const onDataStateChange = async (event: ServerEvent<GridDataStateChangeEvent>) => {
    'use server';

    cookies().set(TAG, JSON.stringify(event.dataState)); 
};

return <Grid onDataStateChange={onDataStateChange} dataItemKey={dataItemKey}></Grid>;
Limitations Client-only Events

There are some current events of the Grid that only make sense in a client scenario. As a result, the following events will not be triggered when the Grid is used as a server component:

Suggested Links

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4