SYIDAX GRID

Data and events

Grid APIs read or change the current state; events report the results of user interactions or data changes. Combine them to build save buttons, detail panels, and change histories.

How it works and when to use it

Most public methods return Promises, so use await to read completion results. Event names are case-sensitive, and payloads are carried in CustomEvent.detail.

In the code, grid is the Grid element prepared in the installation chapter. Check each example's data and settings, and implement the app functions and server endpoints for your project.

Example 1. Read editing results

Check the actual event type for the edited cell and its before/after values.

javascript
const controller = new AbortController();
grid.addEventListener('cellValueChanged', event => {
  console.log(event.detail);
}, { signal: controller.signal });

Verify the result: Build the app's save payload from actual changes rather than counting events.

Example 2. Check call results

Read selected rows through the API instead of assuming they are the first items in the source array.

javascript
const selectedIds = await grid.getSelectedRowIds();
console.log(selectedIds);

Verify the result: Use selected IDs to determine approval or export targets. Calling a method and completing a server save are separate steps.

Example 3. Clean up on view disposal

Use the first example's AbortController to remove subscriptions together.

javascript
controller.abort();

Verify the result: Events will not run twice when the view reopens. Also clean up app-created WebSockets, timers, and requests.

Combining features and troubleshooting

Writing the same value after receiving an event can create an event loop. Distinguish user changes from app-applied updates.

Do not confuse an event's rowIndex with a stable rowId. Use IDs for persistent keys.

Related reading