New to Kendo UI for Angular? Start a free 30-day trial

CancelCommandDirective

Represents the cancel command of the TreeList. You can apply this directive to any button element inside a CommandColumnComponent. When an associated button with the directive is clicked, the cancel event is triggered (see example).

  • When the row is not in the edit mode, the button with the kendoTreeListCancelCommand is automatically hidden.
  • The directive takes as input the cellContext from the cell template.
<kendo-treelist>
  <kendo-treelist-command-column title="command">
    <ng-template kendoTreeListCellTemplate let-cellContext="cellContext">
      <button [kendoTreeListCancelCommand]="cellContext">Cancel changes</button>
    </ng-template>
  </kendo-treelist-command-column>
</kendo-treelist>

You can control the content of the button based on the state of the row.

<kendo-treelist>
  <kendo-treelist-command-column title="command">
    <ng-template kendoTreeListCellTemplate let-cellContext="cellContext" let-isNew="isNew">
      <button [kendoTreeListCancelCommand]="cellContext">{{isNew ? 'Discard' : 'Cancel changes'}}</button>
    </ng-template>
  </kendo-treelist-command-column>
</kendo-treelist>

Selector

[kendoTreeListCancelCommand]

Inputs

kendoTreeListCancelCommand

any

The cellContext provided to the template.

Fields

disabled

boolean

If set to true, it disables the Button.

fillMode

ButtonFillMode

The fillMode property specifies the background and border styles of the Button (see example).

The possible values are:

  • 'flat'
  • 'solid' (default)
  • 'outline'
  • 'clear'
  • 'link'
  • null

icon

string

Defines the name for an existing icon in a Kendo UI theme. The icon is rendered inside the Button by a span.k-icon element.

iconClass

string

Defines a CSS class—or multiple classes separated by spaces— which are applied to a span element inside the Button. Allows the usage of custom icons.

imageUrl

string

Defines a URL which is used for an img element inside the Button. The URL can be relative or absolute. If relative, it is evaluated with relation to the web page URL.

rounded

ButtonRounded

The rounded property specifies the border radius of the Button (see example).

The possible values are:

  • 'small'
  • 'medium' (default)
  • 'large'
  • 'full'
  • null

selected

boolean

Sets the selected state of the Button.

shape

ButtonShape

The shape property specifies if the Button will form a rectangle or square. (see example).

The possible values are:

  • 'square'
  • 'rectangle' (default)

size

ButtonSize

The size property specifies the padding of the Button (see example).

The possible values are:

  • 'small'
  • 'medium' (default)
  • 'large'
  • null

themeColor

ButtonThemeColor

The Button allows you to specify predefined theme colors. The theme color will be applied as a background and border color while also amending the text color accordingly (see example).

The possible values are:

  • 'base' (default)
  • 'primary'
  • 'secondary'
  • 'tertiary'
  • 'info'
  • 'success'
  • 'warning'
  • 'error'
  • 'dark'
  • 'light'
  • 'inverse'

toggleable

boolean

Provides visual styling that indicates if the Button is active. By default, toggleable is set to false.

Events

click

EventEmitter<any>

Fires each time the user clicks the button.

selectedChange

EventEmitter<any>

Fires each time the selected state of a toggleable button is changed.

The event argument is the new selected state (boolean).

Methods

blur

Blurs the Button component.

focus

Focuses the Button component.