ChangeButton
The Status component is used to show the current status of a datasource.
import { ChangeButton } from "@schukai/monster/source/components/datatable/change-button.mjs";Introduction
monster-datatable-change-button offers an action trigger for row changes and editing workflows inside datatable contexts.
Key Features
- Datatable-aware actions: Integrates with row and item state.
- Overlay integration: Can open change flows close to the table.
- Workflow friendly: Fits edit, inspect, and confirmation paths.
Simple Change Button
This example opens a small overlay with row details when a change button is clicked inside the datatable.
Javascript
import "@schukai/monster/source/components/datatable/datasource/dom.mjs";
import "@schukai/monster/source/components/datatable/dataset.mjs";
import "@schukai/monster/source/components/datatable/datatable.mjs";
import "@schukai/monster/source/components/datatable/change-button.mjs";
import "@schukai/monster/source/components/layout/overlay.mjs";
import "@schukai/monster/source/components/form/state-button.mjs";
const table = document.getElementById("change-button-demo-table");
table.setOption("datasource.selector", "#change-button-demo-source");<script type="module">import "@schukai/monster/source/components/datatable/datasource/dom.mjs";
import "@schukai/monster/source/components/datatable/dataset.mjs";
import "@schukai/monster/source/components/datatable/datatable.mjs";
import "@schukai/monster/source/components/datatable/change-button.mjs";
import "@schukai/monster/source/components/layout/overlay.mjs";
import "@schukai/monster/source/components/form/state-button.mjs";
const table = document.getElementById("change-button-demo-table-run");
table.setOption("datasource.selector", "#change-button-demo-source-run");</script>HTML
<monster-datasource-dom id="change-button-demo-source">
<script type="application/json">
{
"dataset": [
{ "id": 1, "name": "Starter", "owner": "Jane" },
{ "id": 2, "name": "Business", "owner": "Mark" },
{ "id": 3, "name": "Enterprise", "owner": "Nina" }
]
}
</script>
</monster-datasource-dom>
<monster-overlay id="change-button-demo-overlay">
<monster-dataset
id="change-button-demo-details"
data-monster-option-datasource-selector="#change-button-demo-source"
>
<div style="display:grid;gap:0.35rem;padding:1rem;">
<strong data-monster-replace="path:data.name"></strong>
<span data-monster-replace="path:data.owner"></span>
</div>
</monster-dataset>
</monster-overlay>
<monster-datatable id="change-button-demo-table">
<template id="row">
<div data-monster-head="id" data-monster-replace="path:row.id"></div>
<div data-monster-head="name" data-monster-replace="path:row.name"></div>
<div data-monster-head="owner" data-monster-replace="path:row.owner"></div>
<monster-datatable-change-button
data-monster-head="details"
data-monster-option-dataset-selector="#change-button-demo-details"
data-monster-option-overlay-selector="#change-button-demo-overlay"
></monster-datatable-change-button>
</template>
</monster-datatable>Stylesheet
/** no additional stylesheet is defined **/Component Design
The button resolves its datatable context, reads the selected data, and forwards the interaction into an attached change or overlay workflow.
Styling Hooks
dataset.overlaySelector: Targets the related overlay.dataset.rowMode: Coordinates the action with row handling.::part(button): Styles the action trigger.
HTML Structure
<monster-change-button></monster-change-button>JavaScript Initialization
const element = document.createElement('monster-change-button');
document.body.appendChild(element);Exported
ChangeButtonDerived from
CustomElementOptions
The Options listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the CustomElement.
- since
- deprecated
Properties and Attributes
The Properties and Attributes listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits Properties and Attributes from these parent classes. If you cannot find a specific Properties and Attributes in this list, we recommend consulting the documentation of the CustomElement.
data-monster-options: Sets the configuration options for the collapse component when used as an HTML attribute.data-monster-option-[name]: Sets the value of the configuration option[name]for the collapse component when used as an HTML attribute.
Methods
The methods listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the CustomElement.
Static methods
[instanceSymbol]()- {symbol}
instanceof operator.getCSSStyleSheet()- [CSSStyleSheet]
getTag()- {string}
Lifecycle methods
Lifecycle methods are called by the environment and are usually not intended to be called directly.
[assembleMethodSymbol]()Events
This component does not fire any public events. It may fire events that are inherited from its parent classes.