Skip to content

Commit

Permalink
docs(custom_row): added dynamic custom file render in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanm-crest committed Jun 20, 2024
1 parent 5878607 commit 231a01d
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions docs/custom_ui_extensions/custom_row.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,41 +41,8 @@ When a row is expanded on the Inputs table, Custom Row is utilized to incorporat

### Example

```
class CustomInputRow {
/**
* Custom Row Cell
* @constructor
* @param {Object} globalConfig - Global configuration.
* @param {string} serviceName - Input service name.
* @param {element} el - The element of the custom cell.
* @param {Object} row - custom row object,
* use this.row.<field_name>, where <field_name> is a field name
*/
constructor(globalConfig, serviceName, el, row) {
this.globalConfig = globalConfig;
this.serviceName = serviceName;
this.el = el;
this.row = row;
}
getDLRows() {
return Object.fromEntries(
Object.entries(this.row).map(([key, value]) => [
key,
key === "interval" ? `${value} sec` : value,
])
);
}
render() {
const content_html_template = 'Custom Input Row';
this.el.innerHTML = content_html_template;
return this;
}
}
export default CustomInputRow;
```js
--8<-- "tests/testdata/test_addons/package_global_config_everything/package/appserver/static/js/build/custom/custom_input_row.js"
```

> Note:
Expand Down

0 comments on commit 231a01d

Please sign in to comment.