メインコンテンツまでスキップ
バージョン: 1.3.2

Button

Overview

Button は、ボタンを表示します。


Specification

Property

使用できるプロパティの一覧です。プロパティを指定して値を更新することができます。

NameTypeDefaultDescriptionRemark
classNamestring""コンポーネントの class 名
idstring""コンポーネントの id 名
textstring""ボタンに表示するテキスト
typestring"normal"ボタンのデザインタイプ以下を指定できる
"normal" : Gray(#f7f9fA)
"submit" : Blue(#3498db)
"alert" : Red(#e74c3c)
disabledbooleanfalseコンポーネントの編集可/不可設定
visiblebooleantrueコンポーネントの表示/非表示設定

Event

指定できるイベントの一覧です。

NameTypeDescriptionRemark
clickfunctionクリックされた時のイベントハンドラ引数には Event の event オブジェクトをとる

Constructor

Button(options)
使用できるコンストラクタの一覧です。

Parameter

NameTypeDefaultDescriptionRemark
optionsobject{}コンポーネントのプロパティを含むオブジェクト

Sample Code

全てのパラメータを指定した場合のサンプルコードです。

const header = kintone.app.getHeaderMenuSpaceElement();
const button = new Kuc.Button({
text: 'Submit',
type: 'submit',
className: 'options-class',
id: 'options-id',
visible: true,
disabled: false
});
header.appendChild(button);

button.addEventListener('click', event => {
console.log(event);
});