Example - Stock Item Supplier
This example demonstrates how to achieve the following:
- How to create child dialog.
- How to use child methods for single item, using prefix to separate redux state.
- How to return data from dialog to the parent form.
Coming Soon
{
"version": "1.0",
"pages": [
"stock/stock-item-suppliers",
"stock/new-stock-item",
"stock/view-stock-item",
"stock/amend-stock-item"
],
"uiExtensions": [
{
"id": "PartNumberExt",
"component": [
{
"Textbox": {
"id": "text_1",
"disabled": true,
}
},
{
"Textbox": {
"id": "spare_text_1",
"disabled": true,
}
}
]
},
{
"id": "AddInColumn",
"component": {
"GridColumn": {
"index": "1",
"headerName": "Text",
"field": "text_1",
"editable": true,
"controlType": "textbox"
}
}
},
{
"id": "SupplierDialogAddIn",
"panel": "bottom",
"component": {
"Textbox": {
"id": "supplier_dialog/text_1"
}
}
}
],
"validations": {
"warnings": [
{
"gridName": "suppliers",
"field": "text_1",
"type": "string",
"constraints": {
"required": {
"message": "Is required"
}
}
},
{
"field": "spare_text_1",
"type": "string",
"constraints": {
"required": {
"message": "Is required"
}
}
},
{
"field": "part_number",
"type": "string",
"constraints": {
"required": {
"message": "Is required"
}
}
}
]
},
"events": [
{
"onLoad": [
{
"set": {
"pageExtension": {
"componentId": "part_number",
"panel": "bottom",
"uiExtension": "PartNumberExt"
}
}
},
{
"set": {
"componentExtension": {
"componentId": "suppliers",
"uiExtension": "AddInColumn"
}
}
}
]
},
{
"formIds": [
"StockItemSupplierForm"
],
"onLoad": [
{
"set": {
"pageExtension": {
"componentId": "supplier_dialog/supplier_stock_code",
"panel": "bottom",
"uiExtension": "SupplierDialogAddIn"
}
}
}
]
},
{
"pages": [
"stock/amend-stock-item"
],
"onStateChange": [
{
"watchTarget": "code",
"onChange": [
{
"if": {
"ne": [
{
"get": {
"state": "code"
}
},
{
"string": {
"value": ""
}
}
],
"then": [
{
"set": {
"properties": {
"text_1": {
"disabled": false
}
}
}
},
{
"set": {
"properties": {
"spare_text_1": {
"disabled": false
}
}
}
}
]
}
}
]
}
]
}
]
}