{/* Do not edit this file. It is automatically generated by API Documenter. */}


## CustomCellRendererImpl

It is a parent class of user-defined renderer.

**Signature:**

```typescript
export declare abstract class CustomCellRendererImpl extends DataCellRenderer
```

**Extends:** DataCellRenderer

## Remarks

get styleName, \_doInitContent, \_doClearContent, render must be implemented.

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(type)](/refs/(constructor)) | | Constructs a new instance of the `CustomCellRendererImpl` class |

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [clickOnlyFocusedCell](/refs/Class/CustomCellRendererImpl#clickonlyfocusedcell) | boolean | If `true`{/* */}, the click event occurs only when the cell is to be focused or when the focus can be moved. [CellRenderer.clickOnlyFocusedCell](/refs/Interface/CellRenderer#clickonlyfocusedcell) |
| [dom](/refs/Class/CustomCellRendererImpl#dom) | HTMLElement | |
| [grid](/refs/Class/CustomCellRendererImpl#grid) | [GridBase](/refs/Class/GridBase) | Grid object referenced by Renderer |
| [index](/refs/Class/CustomCellRendererImpl#index) | [CellIndex](/refs/Interface/CellIndex) | Index of the cell referenced by the renderer |
| [inputFocusable](/refs/Class/CustomCellRendererImpl#inputfocusable) | boolean | |
| [itemClickable](/refs/Class/CustomCellRendererImpl#itemclickable) | boolean | |
| [refreshFocusChanged](/refs/Class/CustomCellRendererImpl#refreshfocuschanged) | boolean | If `true`{/* */}, the cell is redrawn when focus is moved. |
| [showTooltip](/refs/Class/CustomCellRendererImpl#showtooltip) | boolean | Tooltip visibility |
| [styleName](/refs/Class/CustomCellRendererImpl#stylename) | string | Renderer class |
| [type](/refs/Class/CustomCellRendererImpl#type) | string | type of renderer |

## Methods

| Method | Type | Description |
| --- | --- | --- |
| [\_doClearContent(dom)](/refs/Class/CustomCellRendererImpl#_doclearcontent) | protected abstract \_doClearContent(dom: HTMLElement): void; | Callback fired when Renderer is removed |
| [\_doEditClick(index, event, result)](/refs/Class/CustomCellRendererImpl#_doeditclick) | protected \_doEditClick(index: [CellIndex](/refs/Interface/CellIndex){/* */}, event: MouseEvent, result: [RendererEditResult](/refs/Interface/RendererEditResult){/* */}): boolean ; | |
| [\_doInitContent(dom)](/refs/Class/CustomCellRendererImpl#_doinitcontent) | protected abstract \_doInitContent(dom: HTMLElement): void; | Callback that occurs when the renderer is first drawn |
| [canClick(event)](/refs/Class/CustomCellRendererImpl#canclick) | canClick(event: MouseEvent): boolean; | Whether to use grid click event |
| [canClickSpaceKey(event)](/refs/Class/CustomCellRendererImpl#canclickspacekey) | canClickSpaceKey(event: Event): boolean; | When a specific key is down, if `true`{/* */} is returned, itemClick is called. |
| [canEdit()](/refs/Class/CustomCellRendererImpl#canedit) | canEdit(): boolean; | Whether the renderer is editable |
| [canEditClickAt(event)](/refs/Class/CustomCellRendererImpl#caneditclickat) | canEditClickAt(event: MouseEvent): boolean; | Whether to change to edit state when a click occurs in an editable cell |
| [click(index, event, target)](/refs/Class/CustomCellRendererImpl#click) | click(index: [CellIndex](/refs/Interface/CellIndex){/* */}, event: Event, target?: HTMLElement): any; | If the element is clickable when the element is clicked, [ClickData](/refs/Interface/ClickData){/* */} is returned. |
| [itemClick(event)](/refs/Class/CustomCellRendererImpl#itemclick) | itemClick(event: Event): void; | Method called when `true`{/* */} is returned in [CustomCellRendererImpl.canClickSpaceKey()](/refs/Class/CustomCellRendererImpl#canclickspacekey){/* */} |
| [preventDefaultClick(event)](/refs/Class/CustomCellRendererImpl#preventdefaultclick) | preventDefaultClick(event: Event): void; | When the clicked element is a tag (anchor, etc.) with a basic action, the basic action is stopped. |
| [preventDefaultEditClick(event)](/refs/Class/CustomCellRendererImpl#preventdefaulteditclick) | preventDefaultEditClick(event: MouseEvent): void; | Used to stop basic operation when the clicked element is an editable tag. |
| [render(grid, model, w, h, info)](/refs/Class/CustomCellRendererImpl#render) | protected abstract render(grid: [GridBase](/refs/Class/GridBase){/* */}, model: [GridCell](/refs/Interface/GridCell){/* */}, w: number, h: number, info: any): void; | Callback to be executed when rendering |
| [tooltip(model, index)](/refs/Class/CustomCellRendererImpl#tooltip) | tooltip(model: [GridCell](/refs/Interface/GridCell){/* */}, index: [CellIndex](/refs/Interface/CellIndex){/* */}): string; | |

## Construct Desc

### (constructor)

Constructs a new instance of the `CustomCellRendererImpl` class

<hr/>

## Properties Desc

### clickOnlyFocusedCell

If `true`{/* */}, the click event occurs only when the cell is to be focused or when the focus can be moved. [CellRenderer.clickOnlyFocusedCell](/refs/Interface/CellRenderer#clickonlyfocusedcell)

`Type` - boolean

<hr/>

### dom

`Type` - HTMLElement

<hr/>

### grid

Grid object referenced by Renderer

`Type` - [GridBase](/refs/Class/GridBase)

**Remarks:**

It should not be overridden.

<hr/>

### index

Index of the cell referenced by the renderer

`Type` - [CellIndex](/refs/Interface/CellIndex)

**Remarks:**

It should not be overridden.

It is slightly different from the interface exposed to the outside.

<hr/>

### inputFocusable

`Type` - boolean

<hr/>

### itemClickable

`Type` - boolean

<hr/>

### refreshFocusChanged

If `true`{/* */}, the cell is redrawn when focus is moved.

`Type` - boolean

**Remarks:**

Used when the cell needs to be updated when it has focus.

<hr/>

### showTooltip

Whether to display tooltips

`Type` - boolean

<hr/>

### styleName

Renderer class

`Type` - string

**Remarks:**

`rg-renderer ` + Must return with a user-specified class name.

<hr/>

### type

type of renderer

`Type` - string

**Remarks:**

The name used when registering with registerCustomerRenderer becomes the type.

It should not be overridden.

<hr/>

## Method Desc

### \_doClearContent

Callback fired when the renderer is removed

**Remarks:**

Removes elements created in \_doInitContent.

<hr/>

### \_doEditClick

<hr/>

### \_doInitContent

A callback that occurs when the renderer is first drawn.

**\[Parameter List\]**

`dom` - HTMLElement

parentElement

**\[Return Value\] -** void

**Remarks:**

Creates elements to be displayed on the actual screen and adds them to the passed dom.

In addition, it initializes internal properties to be used in the renderer.

When using addEventListener, you must remove it with removeEventListener in \_doClearContent.

<hr/>

### canClick

Whether to use grid click event

**\[Parameter List\]**

`event` - MouseEvent

mouse click event

**\[return value\] -** boolean

**Remarks:**

If you return `false`{/* */}, the grid will not process the click event and will perform the element's basic action.

<hr/>

### canClickSpaceKey

When a specific key is down, if `true`{/* */} is returned, itemClick is called.

**\[Parameter List\]**

`event` - Event

keyboard event

**\[return value\] -** boolean

**Remarks:**

Use it to create the same flow as clicking with the mouse.

<hr/>

### canEdit

Is the renderer editable?

**Remarks:**

If it is a renderer whose value changes by clicking, such as [CheckCellRenderer](/refs/Interface/CheckCellRenderer){/* */}, it returns `true`{/* */}.

<hr/>

### canEditClickAt

Whether to change to edit state when a click occurs in an editable cell

**\[Parameter List\]**

`event` - MouseEvent

mouse click event

**\[return value\] -** boolean

**Remarks:**

If `true`{/* */} is returned, the status of the corresponding row is changed to editing.

<hr/>

### click

If the element is clickable when the element is clicked, [ClickData](/refs/Interface/ClickData){/* */} is returned.

**\[Parameter List\]**

`index` - [CellIndex](/refs/Interface/CellIndex)

Cell location information model

`event` - Event

mouse event

`target` - HTMLElement

clicked element

**\[return value\] -** any

**Remarks:**

The returned data is delivered to the [GridBase.onCellItemClicked](/refs/Class/GridBase#oncellitemclicked){/* */} event.

When returning `false`{/* */}, stop the event and call [CustomCellRendererImpl.preventDefaultClick()](/refs/Class/CustomCellRendererImpl#preventdefaultclick){/* */}.

<hr/>

### itemClick

Method called when `true`{/* */} is returned in [CustomCellRendererImpl.canClickSpaceKey()](/refs/Class/CustomCellRendererImpl#canclickspacekey){/* */}

**\[Parameter List\]**

`event` - Event

keyboard event

**\[Return Value\] -** void

**Remarks:**

Inside the grid, it is used to replace element click with the keyboard.

<hr/>

### preventDefaultClick

When the clicked element is a tag (anchor, etc.) with a basic action, the basic action is stopped.

**\[Parameter List\]**

`event` - Event

mouse event

**\[Return Value\] -** void

**Remarks:**

Called when `false`{/* */} is returned in [GridBase.onCellItemClicked](/refs/Class/GridBase#oncellitemclicked){/* */}.

<hr/>

### preventDefaultEditClick

Used to stop basic operation when the clicked element is an editable tag.

**\[Parameter List\]**

`event` - MouseEvent

mouse event

**\[Return Value\] -** void

**Remarks:**

When mouse and keyboard events occur, the grid processes them internally and stops event propagation.

When you click on a label like &amp;lt;input type='checkbox' id='test'/&amp;gt;&amp;lt;label for='test'&amp;gt;test&amp;lt;/label&amp;gt;

If clicking on the label and input occurs sequentially, it should not be stopped, so preventDefaultEditClick must be redefined to prevent it from stopping.

<hr/>

### render

Callback to be executed when rendering

**\[Parameter List\]**

`grid` - [GridBase](/refs/Class/GridBase)

[GridBase](/refs/Class/GridBase){/* */}Control

`model` - [GridCell](/refs/Interface/GridCell)

[GridCell](/refs/Interface/GridCell) object

`w` - number

width

`h` - number

height

`info` - any

**\[Return Value\] -** void

**Remarks:**

Called when the screen scrolls or data changes.

The renderer should not create or remove elements here because the actual location is not changed and is reused.

If possible, create all necessary elements in \_doInitContent and only change properties such as style or text inside render.

<hr/>

### tooltip

**\[Parameter List\]**

`model` - [GridCell](/refs/Interface/GridCell)

[GridCell](/refs/Interface/GridCell) object

`index` - [CellIndex](/refs/Interface/CellIndex)

Cell location information model

**\[return value\] -** string

<hr/>