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

SaveCommandDirective

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

When the row is not in the edit mode, the button with kendoGridSaveCommand is automatically hidden.

<kendo-grid>
  <kendo-grid-command-column title="command">
    <ng-template kendoGridCellTemplate>
      <button kendoGridSaveCommand>Save changes</button>
    </ng-template>
  </kendo-grid-command-column>
</kendo-grid>

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

<kendo-grid>
  <kendo-grid-command-column title="command">
    <ng-template kendoGridCellTemplate let-isNew="isNew">
      <button kendoGridSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
    </ng-template>
  </kendo-grid-command-column>
</kendo-grid>

Selector

[kendoGridSaveCommand]

Fields

disabled

boolean

If set to true, it disables the Button.

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 classor 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.

look

ButtonLook | "clear"

Changes the visual appearance by using alternative styling options (more information and examples).

The available values are:

primary

boolean

Adds visual weight to the Button and makes it primary.

selected

boolean

Sets the selected state of the Button.

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.