# Flashing Rows

Canonical page: https://www.adaptabletools.com/docs/handbook-flashing-row

- Rows as well as Cells can be made to Flash due to a data change
- This is often used with data that changes infrequently

Most use cases of Flashing involve Cells which change colour briefly when their contents change.

However whole Rows can be made to Flash in response to data changes.

This is done by setting the target of the Flashing Cell Definition to `row`

A common use case is when data changes infrequently and users want to see what has changed.

In this scenario you can set the *Duration* to `always` so that the changed Row remains coloured until manually cleared
 

**Example: Flashing Rows on Cell Change**

Flashing a Whole Row when Cells Change

- This example demonstrates how to flash a whole row
- The `Github Stars` Column has been set up to 'tick' every 2 seconds
- The Flashing Definition sets the **whole row** to flash when the Column ticks and to remain coloured **indefinitely**

- Clear any coloured rows by selecting *Clear Flashing Cell for Row* from the [Context Menu](https://www.adaptabletools.com/docs/ui-context-menu/index.md)
- Or by clicking the *Clear All Flashing Rows* Custom Dashboard Button

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts      [template]
  columnDefs.ts         [template]
  gridOptions.ts        [template]
  index.ts              [template]
  onAdaptableReady.ts
  rowData.ts            [template]
  styles.css            [template]
  tickingDataHelper.ts  [template]
index.html              [template]
package.json            [template]
tsconfig.json           [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {
  AdaptableButton,
  AdaptableOptions,
  DashboardButtonContext,
} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Flashing Row',
  dashboardOptions: {
    customDashboardButtons: [
      {
        label: 'Clear All Flashing Rows',
        onClick: (
          button: AdaptableButton<DashboardButtonContext>,
          context: DashboardButtonContext
        ) => {
          context.adaptableApi.flashingCellApi.clearAllFlashingCells();
        },
        buttonStyle: {
          variant: 'raised',
          tone: 'neutral',
        },
      },
    ],
  },
  initialState: {
    Dashboard: {
      ModuleButtons: ['FlashingCell'],
    },
    Theme: {CurrentTheme: 'dark'},
    FlashingCell: {
      FlashingCellDefinitions: [
        {
          Name: 'flashingCell-language-TypeScript',
          Scope: {
            All: true,
          },
          Rule: '[language] = "TypeScript"',
          FlashTarget: 'row',
          FlashDuration: 'always',
        },
      ],
    },
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'has_projects',
            'has_pages',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```

**`src/onAdaptableReady.ts`**

```ts
import {AdaptableReadyInfo} from '@adaptabletools/adaptable';
import {tickNumericData} from './tickingDataHelper';

export const onAdaptableReady = ({adaptableApi}: AdaptableReadyInfo) => {
  tickNumericData(adaptableApi, 2000, ['github_stars']);
};
```
