-
Hi Renaud, how does that “add” button magically appear iln the live demo config? Folkert |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
It has to be :) There is absolutely no magic in DLite and every component is in the JSON source. I have opened the live demo, switched to JSON, and I can clearly find the "Add" button. Please be more specific (JSON source, actions you do, ...) {
"cid": "index",
"type": "ContainerView",
"dataType": "object",
"layout": "block",
"components": [
{
"cid": "container-2",
"type": "ContainerView",
"dataType": "object",
"layout": "block",
"components": [
{
"cid": "datepicker-0",
"type": "DatepickerView",
"dataType": "date",
"label": "Due date",
"disabled": false,
"eventHandlers": [],
"field": "dueDate",
"dataSource": "$parent"
},
{
"cid": "card-0",
"type": "CardView",
"title": "",
"subTitle": "",
"imgSrc": "",
"imgPosition": "top",
"imgWidth": "",
"imgHeight": "",
"text": "",
"headerEnabled": true,
"header": {
"cid": "text-0",
"type": "TextView",
"dataType": "string",
"tag": "b",
"text": "Line",
"eventHandlers": []
},
"body": {
"cid": "container-1",
"type": "ContainerView",
"dataType": "array",
"layout": "block",
"components": [
{
"cid": "button-3",
"type": "ButtonView",
"dataSource": "$parent",
"label": "Add",
"buttonType": "button",
"eventHandlers": [
{
"global": false,
"name": "@click",
"actions": [
{
"targetId": "$self",
"name": "addData",
"description": "Add instance",
"argument": "{}"
}
]
}
],
"size": "sm",
"icon": "plus",
"variant": "primary"
},
{
"cid": "iterator-0",
"type": "IteratorView",
"dataType": "array",
"defaultValue": "=[]",
"body": {
"cid": "container-0",
"type": "ContainerView",
"dataType": "object",
"layout": "block",
"components": [
{
"cid": "input-0",
"type": "InputView",
"dataType": "string",
"label": "Description",
"inputType": "text",
"description": "",
"field": "description",
"size": "sm",
"disabled": false,
"placeholder": "",
"eventHandlers": [],
"class": "mr-2 mb-0",
"layoutClass": "align-self-end",
"dataSource": "$parent"
},
{
"cid": "input-1",
"type": "InputView",
"dataType": "number",
"label": "Amount",
"inputType": "number",
"description": "",
"field": "amount",
"size": "sm",
"disabled": false,
"placeholder": "",
"eventHandlers": [],
"class": "mr-2 mb-0",
"layoutClass": "align-self-end",
"dataSource": "$parent"
},
{
"cid": "button-0",
"type": "ButtonView",
"dataSource": "$parent",
"label": "",
"buttonType": "button",
"eventHandlers": [
{
"global": false,
"name": "@click",
"actions": [
{
"targetId": "iterator-0",
"name": "moveDataFromTo",
"description": "Move up",
"argument": "iteratorIndex, iteratorIndex - 1"
}
]
}
],
"size": "sm",
"icon": "arrow-up",
"layoutClass": "align-self-end",
"disabled": "=(iteratorIndex === 0)"
},
{
"cid": "button-1",
"type": "ButtonView",
"dataSource": "$parent",
"label": "",
"buttonType": "button",
"eventHandlers": [
{
"global": false,
"name": "@click",
"actions": [
{
"targetId": "iterator-0",
"name": "moveDataFromTo",
"description": "Move down",
"argument": "iteratorIndex, iteratorIndex + 1"
}
]
}
],
"size": "sm",
"icon": "arrow-down",
"layoutClass": "align-self-end",
"disabled": "=(iteratorIndex === $d('iterator-0').length - 1)"
},
{
"cid": "button-2",
"type": "ButtonView",
"dataSource": "$parent",
"label": "",
"buttonType": "button",
"eventHandlers": [
{
"global": false,
"name": "@click",
"actions": [
{
"targetId": "iterator-0",
"name": "removeDataAt",
"description": "Remove",
"argument": "iteratorIndex"
}
]
}
],
"size": "sm",
"icon": "trash",
"layoutClass": "align-self-end",
"variant": "danger"
}
],
"defaultValue": "={}",
"eventHandlers": [],
"dataSource": "$parent",
"direction": "row"
},
"eventHandlers": [],
"dataSource": "$parent"
}
],
"defaultValue": "=[]",
"eventHandlers": [],
"dataSource": "$parent",
"field": "line"
},
"footer": {},
"eventHandlers": [],
"dataSource": "$parent"
},
{
"cid": "input-2",
"type": "InputView",
"dataType": "string",
"label": "Vendor",
"inputType": "text",
"description": "",
"field": "vendor",
"size": "default",
"disabled": false,
"placeholder": "",
"eventHandlers": [],
"dataSource": "$parent"
},
{
"cid": "input-3",
"type": "InputView",
"dataType": "number",
"label": "Total amount",
"inputType": "number",
"description": "",
"field": "totalAmount",
"size": "default",
"disabled": false,
"placeholder": "",
"eventHandlers": [],
"dataSource": "$parent"
}
],
"defaultValue": "={}",
"eventHandlers": []
}
],
"defaultValue": "={}",
"eventHandlers": []
} |
Beta Was this translation helpful? Give feedback.
-
ah... Thanxs for explaining. |
Beta Was this translation helpful? Give feedback.
-
No problems. As you know, you have to types of models in DLite, a view model, which contains all the component configuration (accessible with |
Beta Was this translation helpful? Give feedback.
ah... Thanxs for explaining.