DB2 - Problem with v-table expandable rows

Hi, doing some tests today to build a nice table in DB2 , trying to use v-table in template .

So far so good, but I have a problem with expandable rows :

I'm trying to replicate this from vuetify examples ( https://vuetifyjs.com/en/components/data-tables/basics/#expandable-rows):

But actually what I get in my table looks like this :

Maybe someone could help me to trouble shoot or give me a direction ?

Here is a code sample :

[
    {
        "id": "7239567b6bf2a2ca",
        "type": "inject",
        "z": "49f4dd83f48e75ca",
        "name": "Trigger",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.5",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1060,
        "y": 280,
        "wires": [
            [
                "26aee7d32cdea4e2"
            ]
        ]
    },
    {
        "id": "3805253c14d46132",
        "type": "ui-template",
        "z": "49f4dd83f48e75ca",
        "group": "fb2e77ec2c2a5dd1",
        "page": "",
        "ui": "",
        "name": "File Explorer",
        "order": 5,
        "width": "0",
        "height": "0",
        "head": "",
        "format": "<template>\n  <!-- Provide an input text box to search the content -->\n  <v-text-field v-model=\"search\" label=\"Search\" prepend-inner-icon=\"mdi-magnify\" single-line variant=\"outlined\"\n    hide-details></v-text-field>\n  <v-data-table v-model:search=\"search\" :items=\"msg?.payload\" :group-by=\"msg?.groupBy\" :headers=\"msg?.headers\"\n    :sort-by=\"msg?.sortBy\" v-model=\"selected\" item-selectable=\"selectable\" show-expand select-strategy=\"all\"\n    density=\"compact\" show-select return-object>\n\n    <template v-slot:item.icon=\"{ item }\">\n      <v-icon :icon=\"item.icon\"></v-icon>\n    </template>\n\n    <template v-slot:group-header=\"{ item, columns, toggleGroup, isGroupOpen }\">\n      <tr>\n        <td :colspan=\"columns.length\">\n          <div class=\"d-flex align-center\">\n            <v-btn :icon=\"isGroupOpen(item) ? '$expand' : '$next'\" color=\"medium-emphasis\" density=\"comfortable\"\n              size=\"small\" variant=\"outlined\" @click=\"toggleGroup(item)\"></v-btn>\n\n            <span class=\"ms-4\">Location Test: {{ item.value }}</span>\n          </div>\n        </td>\n      </tr>\n    </template>\n\n\n    <template v-slot:item.format=\"{ value }\">\n      <v-chip :border=\"`${getColor(value)} thin opacity-25`\" :color=\"getColor(value)\" :text=\"value\" size=\"small\"\n        variant=\"elevated\">\n      </v-chip>\n    </template>\n\n    <template v-slot:item.data-table-expand=\"{ internalItem, isExpanded, toggleExpand }\">\n      <v-btn :append-icon=\"isExpanded(internalItem) ? 'mdi-chevron-up' : 'mdi-chevron-down'\"\n        :text=\"isExpanded(internalItem) ? 'Collapse' : 'More info'\" class=\"text-none\" color=\"medium-emphasis\"\n        size=\"small\" variant=\"text\" border slim @click=\"toggleExpand(internalItem)\"></v-btn>\n    </template>\n\n    <template v-slot:expanded-row=\"{ columns, item }\">\n      <tr>\n        <td :colspan=\"columns.length\" class=\"py-2\">\n          <v-sheet rounded=\"lg\" border>\n              <tbody class=\"bg-surface-light\">\n                <tr>\n                  <th>Rating</th>\n                  <th>Synopsis</th>\n                  <th>Cast</th>\n                </tr>\n              </tbody>\n\n              <tbody>\n                <tr>\n                  <td>\n                    <v-rating :model-value=\"item.details.rating\" color=\"orange-darken-2\" density=\"comfortable\"\n                      size=\"x-small\" half-increments readonly></v-rating>\n                  </td>\n                  <td>{{ item.details.synopsis }}</td>\n                  <td>{{ item.details.cast.join(', ') }}</td>\n                </tr>\n              </tbody>\n            </v-table>\n          </v-sheet>\n        </td>\n      </tr>\n    </template>\n\n\n  </v-data-table>\n</template>\n\n<script>\n  export default {\n    data () {\n      return {\n        selected: [],\n        search: ''\n      }\n    },\n    watch: {\n        selected: function () {\n          this.send({topic:'selected', payload: this.selected});\n        }\n    },\n    methods: {\n      getColor: function (value) {\n    if (value.includes(\"Vid\")) return 'error'\n    else if (value.includes(\"Aud\")) return 'warning'\n    else return 'success'\n  }\n  \n\n    }\n  }\n</script>",
        "storeOutMessages": true,
        "passthru": false,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 1450,
        "y": 220,
        "wires": [
            [
                "0f0acd5f60be7b78"
            ]
        ]
    },
    {
        "id": "0f0acd5f60be7b78",
        "type": "debug",
        "z": "49f4dd83f48e75ca",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1610,
        "y": 280,
        "wires": []
    },
    {
        "id": "26aee7d32cdea4e2",
        "type": "function",
        "z": "49f4dd83f48e75ca",
        "name": "content with Children headers",
        "func": "\nmsg.payload =\n  [\n    {\n      \"name\": \"'Great Pyramid of Giza'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'146.6'\",\n      \"base\": \"'230.4'\",\n      \"volume\": \"'2583285'\",\n      \"constructionDate\": \"'c. 2580–2560 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\":\"Vid_1080i50\"\n    },\n    {\n      \"name\": \"'Pyramid of Khafre'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'136.4'\",\n      \"base\": \"'215.3'\",\n      \"volume\": \"'1477485'\",\n      \"constructionDate\": \"'c. 2570 BC\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Vid_1080p50\"\n    },\n    {\n      \"name\": \"'Red Pyramid'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'104'\", \"base\": \"'220'\",\n      \"volume\": \"'1602895'\",\n      \"constructionDate\": \"'c. 2590 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Vid_1080i50\"\n    },\n    \n    {\n      \"name\": \"'Red Pyramid 1'\",\n      \"location\": \"'France'\",\n      \"height\": \"'123'\", \"base\": \"'210'\",\n      \"volume\": \"'1602895'\",\n      \"constructionDate\": \"'c. 2590 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Aud_2CH\"\n  },\n  {\n    \"name\": \"'Red Pyramid 2'\",\n    \"location\": \"'France'\",\n    \"height\": \"'456'\", \"base\": \"'220'\",\n    \"volume\": \"'1602895'\",\n    \"constructionDate\": \"'c. 2590 BC'\",\n    \"details\": {\n      \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n      \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n      \"rating\": 3.5,\n    },\n    \"format\": \"Aud_8CH\"\n  },\n  {\n    \"name\": \"'Red Pyramid 2'\",\n    \"location\": \"\",\n    \"height\": \"'456'\", \"base\": \"'220'\",\n    \"volume\": \"'1602895'\",\n    \"constructionDate\": \"'c. 2590 BC'\",\n    \"details\": {\n      \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n      \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n      \"rating\": 3.5,\n    },\n    \"format\": \"Aud_8CH\"\n  }\n  ]\n\nmsg.headers = [\n  { title: 'Pyramid222', value: 'name' },\n  { title: 'Location', value: 'location' },\n  { title: 'Construction Date', value: 'constructionDate', \"sortable\": true, align: 'start' },\n  { title: 'Format', value: 'format', \"sortable\": true, align: 'end' },\n  {\n    title: 'Dimensions',\n    align: 'center',\n    children: [\n      { title: 'Height(m)', value: 'height', \"sortable\": true },\n      { title: 'Base(m)', value: 'base', \"sortable\": true },\n      { title: 'Volume(m³)', value: 'volume', \"sortable\": true },\n    ],\n  },\n]\n//msg.sortBy = [{ key: 'format', order: 'asc' }]\n//msg.groupBy = [{ key: 'location', order: 'asc' }]\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1270,
        "y": 280,
        "wires": [
            [
                "3805253c14d46132"
            ]
        ]
    },
    {
        "id": "fb2e77ec2c2a5dd1",
        "type": "ui-group",
        "name": "Table examples",
        "page": "c466b7e4bb472f99",
        "width": "12",
        "height": "1",
        "order": 1,
        "showTitle": false,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "c466b7e4bb472f99",
        "type": "ui-page",
        "name": "Tables",
        "ui": "cb79bc4520925e32",
        "path": "/tables",
        "icon": "table",
        "layout": "grid",
        "theme": "0d92c765bfad87e6",
        "breakpoints": [
            {
                "name": "Default",
                "px": "0",
                "cols": "3"
            },
            {
                "name": "Tablet",
                "px": "576",
                "cols": "6"
            },
            {
                "name": "Small Desktop",
                "px": "768",
                "cols": "9"
            },
            {
                "name": "Desktop",
                "px": "1024",
                "cols": "12"
            }
        ],
        "order": 1,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "cb79bc4520925e32",
        "type": "ui-base",
        "name": "My UI",
        "path": "/dashboard",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control"
        ],
        "showPathInSidebar": false
    },
    {
        "id": "0d92c765bfad87e6",
        "type": "ui-theme",
        "name": "Basic Blue Theme",
        "colors": {
            "surface": "#4d58ff",
            "primary": "#0094ce",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px",
            "density": "default"
        }
    }
]

Thanks in advance

Seems no one is having that problem... or maybe no one is using the v-table expand feature....

@joepavitt , sorry to ping you directly. I just made another try with an empty flows.json, just got the v-table code from your website, and only added the code for expand feature available from vuetify (link in previous post), but still same problem.... seems to me you are almost the only one with knowledge on this specific topic....

Code is pretty simple actually... would appreciate if you see something weird :

[
    {
        "id": "7239567b6bf2a2ca",
        "type": "inject",
        "z": "49f4dd83f48e75ca",
        "name": "File list",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.5",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1060,
        "y": 280,
        "wires": [
            [
                "26aee7d32cdea4e2"
            ]
        ]
    },
    {
        "id": "0f0acd5f60be7b78",
        "type": "debug",
        "z": "49f4dd83f48e75ca",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1610,
        "y": 280,
        "wires": []
    },
    {
        "id": "26aee7d32cdea4e2",
        "type": "function",
        "z": "49f4dd83f48e75ca",
        "name": "content with Children headers",
        "func": "\nmsg.payload =\n  [\n    {\n      \"name\": \"'Great Pyramid of Giza'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'146.6'\",\n      \"base\": \"'230.4'\",\n      \"volume\": \"'2583285'\",\n      \"constructionDate\": \"'c. 2580–2560 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\":\"Vid_1080i50\"\n    },\n    {\n      \"name\": \"'Pyramid of Khafre'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'136.4'\",\n      \"base\": \"'215.3'\",\n      \"volume\": \"'1477485'\",\n      \"constructionDate\": \"'c. 2570 BC\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Vid_1080p50\"\n    },\n    {\n      \"name\": \"'Red Pyramid'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'104'\", \"base\": \"'220'\",\n      \"volume\": \"'1602895'\",\n      \"constructionDate\": \"'c. 2590 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Vid_1080i50\"\n    },\n    \n    {\n      \"name\": \"'Red Pyramid 1'\",\n      \"location\": \"'France'\",\n      \"height\": \"'123'\", \"base\": \"'210'\",\n      \"volume\": \"'1602895'\",\n      \"constructionDate\": \"'c. 2590 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Aud_2CH\"\n  },\n  {\n    \"name\": \"'Red Pyramid 2'\",\n    \"location\": \"'France'\",\n    \"height\": \"'456'\", \"base\": \"'220'\",\n    \"volume\": \"'1602895'\",\n    \"constructionDate\": \"'c. 2590 BC'\",\n    \"details\": {\n      \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n      \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n      \"rating\": 3.5,\n    },\n    \"format\": \"Aud_8CH\"\n  },\n  {\n    \"name\": \"'Red Pyramid 2'\",\n    \"location\": \"\",\n    \"height\": \"'456'\", \"base\": \"'220'\",\n    \"volume\": \"'1602895'\",\n    \"constructionDate\": \"'c. 2590 BC'\",\n    \"details\": {\n      \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n      \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n      \"rating\": 3.5,\n    },\n    \"format\": \"Aud_8CH\"\n  }\n  ]\n\nmsg.headers = [\n  { title: 'Pyramid222', value: 'name' },\n  { title: 'Location', value: 'location' },\n  { title: 'Construction Date', value: 'constructionDate', \"sortable\": true, align: 'start' },\n  { title: 'Format', value: 'format', \"sortable\": true, align: 'end' },\n  {\n    title: 'Dimensions',\n    align: 'center',\n    children: [\n      { title: 'Height(m)', value: 'height', \"sortable\": true },\n      { title: 'Base(m)', value: 'base', \"sortable\": true },\n      { title: 'Volume(m³)', value: 'volume', \"sortable\": true },\n    ],\n  },\n]\n//msg.sortBy = [{ key: 'format', order: 'asc' }]\n//msg.groupBy = [{ key: 'location', order: 'asc' }]\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1270,
        "y": 280,
        "wires": [
            [
                "3805253c14d46132",
                "e708e7683b1a83b5"
            ]
        ]
    },
    {
        "id": "e708e7683b1a83b5",
        "type": "ui-template",
        "z": "49f4dd83f48e75ca",
        "group": "fb2e77ec2c2a5dd1",
        "page": "",
        "ui": "",
        "name": "",
        "order": 1,
        "width": 0,
        "height": 0,
        "head": "",
        "format": "<template>\n  <!-- Provide an input text box to search the content -->\n  <v-text-field v-model=\"search\" label=\"Search\" prepend-inner-icon=\"mdi-magnify\" single-line variant=\"outlined\"\n    hide-details></v-text-field>\n  <v-data-table v-model:search=\"search\" show-expand :items=\"msg?.payload\" :headers= \"msg?.headers\">\n    <template v-slot:header.current>\n      <!-- Override how we render the header for the \"current\" column -->\n      <div class=\"text-center\">Center-Aligned</div>\n    </template>\n\n    <template v-slot:item.data-table-expand=\"{ internalItem, isExpanded, toggleExpand }\">\n      <v-btn :append-icon=\"isExpanded(internalItem) ? 'mdi-chevron-up' : 'mdi-chevron-down'\"\n        :text=\"isExpanded(internalItem) ? 'Collapse' : 'More info'\" class=\"text-none\" color=\"medium-emphasis\"\n        size=\"small\" variant=\"text\" border slim @click=\"toggleExpand(internalItem)\"></v-btn>\n    </template>\n\n    <template v-slot:expanded-row=\"{ columns, item }\">\n      <tr>\n        <td :colspan=\"columns.length\" class=\"py-2\">\n          <v-sheet rounded=\"lg\" border>\n            <tbody class=\"bg-surface-light\">\n              <tr>\n                <th>Rating</th>\n                <th>Synopsis</th>\n                <th>Cast</th>\n              </tr>\n            </tbody>\n            <tbody>\n              <tr>\n                <td>\n                  <v-rating :model-value=\"item.details.rating\" color=\"orange-darken-2\" density=\"comfortable\"\n                    size=\"x-small\" half-increments readonly></v-rating>\n                </td>\n                <td>{{ item.details.synopsis }}</td>\n                <td>{{ item.details.cast.join(', ') }}</td>\n              </tr>\n            </tbody>\n            </v-table>\n          </v-sheet>\n        </td>\n      </tr>\n    </template>\n\n    <template v-slot:item.format=\"{ value }\">\n      <v-chip :border=\"`${getColor(value)} thin opacity-25`\" :color=\"getColor(value)\" :text=\"value\" size=\"small\"\n        variant=\"elevated\">\n      </v-chip>\n    </template>\n\n    <template v-slot:item.target=\"{ item }\">\n      <!-- Add a custom suffix to the value for the \"target\" column -->\n      {{ item.target }}°C\n    </template>\n\n    <template v-slot:item.current=\"{ item }\">\n      <!-- Render a Linear Progress Bar for the \"current\" column -->\n      <v-progress-linear v-model=\"item.current\" min=\"15\" max=\"25\" height=\"25\" :color=\"getColor(item)\">\n        <template v-slot:default=\"{ value }\">\n          <strong>{{ item.current }}°C</strong>\n        </template>\n      </v-progress-linear>\n    </template>\n\n  </v-data-table>\n</template>\n\n<script>\n  export default {\n    data () {\n      return {\n        search: ''\n      }\n    },\n    methods: {\n      getColor: function (value) {\n    if (value.includes(\"Vid\")) return 'error'\n    else if (value.includes(\"Aud\")) return 'warning'\n    else return 'success'\n  }\n  }\n  }\n</script>",
        "storeOutMessages": true,
        "passthru": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 1390,
        "y": 400,
        "wires": [
            [
                "0f0acd5f60be7b78"
            ]
        ]
    },
    {
        "id": "fb2e77ec2c2a5dd1",
        "type": "ui-group",
        "name": "Table examples",
        "page": "c466b7e4bb472f99",
        "width": "12",
        "height": "1",
        "order": 1,
        "showTitle": false,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "c466b7e4bb472f99",
        "type": "ui-page",
        "name": "Tables",
        "ui": "cb79bc4520925e32",
        "path": "/tables",
        "icon": "table",
        "layout": "grid",
        "theme": "0d92c765bfad87e6",
        "breakpoints": [
            {
                "name": "Default",
                "px": "0",
                "cols": "3"
            },
            {
                "name": "Tablet",
                "px": "576",
                "cols": "6"
            },
            {
                "name": "Small Desktop",
                "px": "768",
                "cols": "9"
            },
            {
                "name": "Desktop",
                "px": "1024",
                "cols": "12"
            }
        ],
        "order": 1,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "cb79bc4520925e32",
        "type": "ui-base",
        "name": "My UI",
        "path": "/dashboard",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control"
        ],
        "showPathInSidebar": false
    },
    {
        "id": "0d92c765bfad87e6",
        "type": "ui-theme",
        "name": "Basic Blue Theme",
        "colors": {
            "surface": "#4d58ff",
            "primary": "#0094ce",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px",
            "density": "default"
        }
    }
]

Hi, there are styling differences between DB2 and vuetify default playground. So sometimes you might need to add classes/custom styling. In your case, adding the w-100 helper class fixes the table width.

Apart from that, you had a issues in your adaptation - the ones I can remember:

  1. missing <v-table> (~line 22)
  2. item-value="name" missing from <v-data-table attributes (messes up the expand feature if wrong/missing)
  3. using tbody for head element (~ line 27) (though I realise this is a vuetify demo site bug)
  4. v-text-field search was outside of a slot

Note, there does also appear to be a bug with nested v-table that was causing the inner table to render its rows into the tr of the main table. The solution is to use a regular table instead.

I will raise an issue.

Anyhow, hope this is enough to get you moving...

chrome_228MhABwKk

[{"id":"21a17f87063e9091","type":"inject","z":"90e2df527c725ffb","name":"Set data","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.5","topic":"data","payload":"[]","payloadType":"json","x":820,"y":1740,"wires":[["937f4d3b9de5b0c8"]]},{"id":"e9ee8e328bbfcb66","type":"debug","z":"90e2df527c725ffb","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1160,"y":1800,"wires":[]},{"id":"937f4d3b9de5b0c8","type":"function","z":"90e2df527c725ffb","name":"content with Children headers","func":"\nmsg.payload =\n  [\n    {\n      \"name\": \"'Great Pyramid of Giza'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'146.6'\",\n      \"base\": \"'230.4'\",\n      \"volume\": \"'2583285'\",\n      \"constructionDate\": \"'c. 2580–2560 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\":\"Vid_1080i50\"\n    },\n    {\n      \"name\": \"'Pyramid of Khafre'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'136.4'\",\n      \"base\": \"'215.3'\",\n      \"volume\": \"'1477485'\",\n      \"constructionDate\": \"'c. 2570 BC\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Vid_1080p50\"\n    },\n    {\n      \"name\": \"'Red Pyramid'\",\n      \"location\": \"'Egypt'\",\n      \"height\": \"'104'\", \"base\": \"'220'\",\n      \"volume\": \"'1602895'\",\n      \"constructionDate\": \"'c. 2590 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Vid_1080i50\"\n    },\n    \n    {\n      \"name\": \"'Red Pyramid 1'\",\n      \"location\": \"'France'\",\n      \"height\": \"'123'\", \"base\": \"'210'\",\n      \"volume\": \"'1602895'\",\n      \"constructionDate\": \"'c. 2590 BC'\",\n      \"details\": {\n        \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n        \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n        \"rating\": 3.5,\n      },\n      \"format\": \"Aud_2CH\"\n  },\n  {\n    \"name\": \"'Red Pyramid 2'\",\n    \"location\": \"'France'\",\n    \"height\": \"'456'\", \"base\": \"'220'\",\n    \"volume\": \"'1602895'\",\n    \"constructionDate\": \"'c. 2590 BC'\",\n    \"details\": {\n      \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n      \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n      \"rating\": 3.5,\n    },\n    \"format\": \"Aud_8CH\"\n  },\n  {\n    \"name\": \"'Red Pyramid 2'\",\n    \"location\": \"\",\n    \"height\": \"'456'\", \"base\": \"'220'\",\n    \"volume\": \"'1602895'\",\n    \"constructionDate\": \"'c. 2590 BC'\",\n    \"details\": {\n      \"synopsis\": 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.',\n      \"cast\": ['Tim Robbins', 'Morgan Freeman'],\n      \"rating\": 3.5,\n    },\n    \"format\": \"Aud_8CH\"\n  }\n  ]\n\nmsg.headers = [\n  { title: 'Pyramid', value: 'name' },\n  { title: 'Location', value: 'location' },\n  { title: 'Construction Date', value: 'constructionDate', \"sortable\": true, align: 'start' },\n  { title: 'Format', value: 'format', \"sortable\": true, align: 'end' },\n  {\n    title: 'Dimensions',\n    align: 'center',\n    children: [\n      { title: 'Height(m)', value: 'height', \"sortable\": true },\n      { title: 'Base(m)', value: 'base', \"sortable\": true },\n      { title: 'Volume(m³)', value: 'volume', \"sortable\": true },\n    ],\n  },\n]\n//msg.sortBy = [{ key: 'format', order: 'asc' }]\n//msg.groupBy = [{ key: 'location', order: 'asc' }]\n\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1050,"y":1740,"wires":[["ad3b02ad651978eb"]]},{"id":"ad3b02ad651978eb","type":"ui-template","z":"90e2df527c725ffb","group":"fb2e77ec2c2a5dd1","page":"","ui":"","name":"","order":1,"width":0,"height":0,"head":"","format":"<template>\n\n    <v-data-table v-model:search=\"search\" :items=\"data\" :headers=\"headers\" show-expand item-value=\"name\">\n\n        <template v-slot:top>\n            <v-text-field v-model=\"search\" label=\"Search\" prepend-inner-icon=\"mdi-magnify\" single-line variant=\"outlined\"\n                hide-details />\n        </template>\n\n        <template #header.current>\n            <div class=\"text-center\">Center-Aligned</div>\n        </template>\n\n        <template #item.data-table-expand=\"{ internalItem, isExpanded, toggleExpand }\">\n            <v-btn\n                :append-icon=\"isExpanded(internalItem) ? 'mdi-chevron-up' : 'mdi-chevron-down'\"\n                :text=\"isExpanded(internalItem) ? 'Collapse' : 'More info'\" class=\"text-none\" color=\"medium-emphasis\"\n                size=\"small\" variant=\"text\" border slim @click=\"toggleExpand(internalItem)\"\n            />\n        </template>\n\n        <template #expanded-row=\"{ columns, item }\">\n            <tr>\n                <td :colspan=\"columns.length\" class=\"py-2\">\n                    <v-sheet rounded=\"lg\" border>\n                        <table density=\"compact\" class=\"w-100\">\n                            <thead class=\"bg-surface-light\">\n                                <tr>\n                                    <th>Rating</th>\n                                    <th>Synopsis</th>\n                                    <th>Cast</th>\n                                </tr>\n                            </thead>\n                            <tbody>\n                                <tr>\n                                    <td>\n                                        <v-rating\n                                            :model-value=\"item.details.rating\" color=\"orange-darken-2\" density=\"comfortable\"\n                                            size=\"x-small\" half-increments readonly\n                                        />\n                                    </td>\n                                    <td>{{ item.details.synopsis }}</td>\n                                    <td>{{ item.details.cast.join(', ') }}</td>\n                                </tr>\n                            </tbody>\n                        </table>\n                    </v-sheet>\n                </td>\n            </tr>\n        </template>\n\n        <template #item.format=\"{ value }\">\n            <v-chip\n                :border=\"`${getColor(value)} thin opacity-25`\" :color=\"getColor(value)\" :text=\"value\" size=\"small\"\n                variant=\"elevated\"\n            />\n        </template>\n\n        <template #item.target=\"{ item }\">\n            {{ item.target }}°C\n        </template>\n\n        <template #item.current=\"{ item }\">\n            <v-progress-linear v-model=\"item.current\" min=\"15\" max=\"25\" height=\"25\" :color=\"getColor(item)\">\n                <template #default=\"{ value }\">\n                    <strong>{{ item.current }}°C</strong>\n                </template>\n            </v-progress-linear>\n        </template>\n    </v-data-table>\n</template>\n\n<script>\nexport default {\n    data () {\n        return {\n            search: '',\n            data: [],\n            headers: []\n        }\n    },\n    watch: {\n    // watch for any changes of \"count\"\n        msg: function () {\n            console.log('new msg')\n            if (this.msg.topic === 'data') {\n                this.data = this.msg.payload || []\n                this.headers = this.msg.headers || []\n            }\n        }\n    },\n    methods: {\n        getColor: function (value) {\n            if (value.includes('Vid')) return 'error'\n            else if (value.includes('Aud')) return 'warning'\n            else return 'success'\n        }\n    }\n}\n</script>\n","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":980,"y":1800,"wires":[["e9ee8e328bbfcb66"]]},{"id":"898c035549195453","type":"inject","z":"90e2df527c725ffb","name":"clear","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"0.5","topic":"data","payload":"[]","payloadType":"json","x":810,"y":1800,"wires":[["ad3b02ad651978eb"]]},{"id":"fb2e77ec2c2a5dd1","type":"ui-group","name":"Table examples","page":"c466b7e4bb472f99","width":"12","height":"1","order":1,"showTitle":false,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"c466b7e4bb472f99","type":"ui-page","name":"Tables","ui":"83289142e2632cc2","path":"/tables","icon":"table","layout":"grid","theme":"0d92c765bfad87e6","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":2,"className":"","visible":"true","disabled":"false"},{"id":"83289142e2632cc2","type":"ui-base","name":"My Dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"default","titleBarStyle":"default","notificationDisplayTime":5},{"id":"0d92c765bfad87e6","type":"ui-theme","name":"Basic Blue Theme","colors":{"surface":"#4d58ff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px","density":"default"}}]
1 Like

Wow !

That might defintely help a lot. Will check all you mention a bit later.

Indeed maybe a bit of mess in the copy paste code , I checked quite a lot but maybe missed a few items. I think it was quite explicit anyway.

Again, thank you very much, I appreciate a lot. Side note, it helps understanding a bit more how template node works, definitely the hardest in NR.... IMHO.

cheers

That's all good, thanks again for your help. I still have a bit of different formatting than yours, but no big deal, I'll investigate on my side.

Cheers