2019-10-18 18:32:03 +02:00
|
|
|
{
|
2020-02-14 12:51:45 +01:00
|
|
|
"inherits": "@budibase/standard-components/container",
|
2019-10-18 18:32:03 +02:00
|
|
|
"name": "customer/homepage buttons",
|
|
|
|
"props": {
|
2019-10-19 08:24:20 +02:00
|
|
|
"className": "btn-toolbar mt-4 mb-2",
|
2019-10-18 18:32:03 +02:00
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"component": {
|
2020-02-14 12:51:45 +01:00
|
|
|
"_component": "@budibase/standard-components/container",
|
2019-10-19 08:24:20 +02:00
|
|
|
"className": "btn-group mr-3",
|
|
|
|
"children": [
|
2019-10-18 18:32:03 +02:00
|
|
|
{
|
2019-10-19 08:24:20 +02:00
|
|
|
"component": {
|
|
|
|
"_component": "common/Default Button",
|
|
|
|
"contentText": "Create customer",
|
|
|
|
"onClick": [
|
|
|
|
{
|
|
|
|
"##eventHandlerType": "Get New Record",
|
|
|
|
"parameters": {
|
|
|
|
"statePath": "customer",
|
|
|
|
"collectionKey": "/customers",
|
|
|
|
"childRecordType": "customer"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"##eventHandlerType": "Set State",
|
|
|
|
"parameters": {
|
|
|
|
"path": "isEditingcustomer",
|
|
|
|
"value": "true"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-10-18 18:32:03 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-10-19 08:24:20 +02:00
|
|
|
"component": {
|
|
|
|
"_component": "common/Default Button",
|
|
|
|
"contentText": "Refresh",
|
|
|
|
"onClick": [
|
|
|
|
{
|
|
|
|
"##eventHandlerType": "List Records",
|
|
|
|
"parameters": {
|
|
|
|
"statePath": "/all_customers",
|
|
|
|
"indexKey": "/all_customers"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-10-18 18:32:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"component": {
|
2019-10-19 08:24:20 +02:00
|
|
|
"_component": "@budibase/standard-components/if",
|
|
|
|
"condition": "$store.selectedrow_all_customers && $store.selectedrow_all_customers.length > 0",
|
|
|
|
"thenComponent": {
|
2020-02-14 12:51:45 +01:00
|
|
|
"_component": "@budibase/standard-components/container",
|
2019-10-19 08:24:20 +02:00
|
|
|
"className": "btn-group",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"component": {
|
|
|
|
"_component": "common/Default Button",
|
|
|
|
"contentText": "Edit customer",
|
|
|
|
"onClick": [
|
|
|
|
{
|
|
|
|
"##eventHandlerType": "Load Record",
|
|
|
|
"parameters": {
|
|
|
|
"statePath": "customer",
|
|
|
|
"recordKey": {
|
|
|
|
"##bbstate": "selectedrow_all_customers",
|
|
|
|
"##source": "store"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"##eventHandlerType": "Set State",
|
|
|
|
"parameters": {
|
|
|
|
"path": "isEditingcustomer",
|
|
|
|
"value": "true"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"component": {
|
|
|
|
"_component": "common/Default Button",
|
|
|
|
"contentText": "Delete customer",
|
|
|
|
"onClick": [
|
|
|
|
{
|
|
|
|
"##eventHandlerType": "Delete Record",
|
|
|
|
"parameters": {
|
|
|
|
"recordKey": {
|
|
|
|
"##bbstate": "selectedrow_all_customers",
|
|
|
|
"##source": "store"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2019-10-18 18:32:03 +02:00
|
|
|
}
|
2019-10-19 08:24:20 +02:00
|
|
|
]
|
|
|
|
}
|
2019-10-18 18:32:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|