First click in table jumps selected row to top

The first click in my table always scrolls the table to get the selected row on top. This only happens on the first clicks after loading the table.I think it has something to do with the selected row, but I just can’t figure it out. Your help is appreciated.

I have recorded the jump in this gif; It shows the jump after the first click, then some more clicks to show it only happens once, and then a scroll up.

2026-01-27 09-10-24

This is the configuration of my table - it contains a navigation event when double clicked, but no single-click events.

[
  {
    "type": "ia.display.table",
    "version": 0,
    "props": {
      "virtualized": false,
      "columns": [
        {
          "align": "center",
          "boolean": "checkbox",
          "dateFormat": "MM/DD/YYYY",
          "editable": false,
          "field": "isOnline",
          "filter": {
            "boolean": {
              "condition": ""
            },
            "date": {
              "condition": "",
              "value": ""
            },
            "enabled": false,
            "number": {
              "condition": "",
              "value": ""
            },
            "string": {
              "condition": "",
              "value": ""
            },
            "visible": "on-hover"
          },
          "footer": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": ""
          },
          "header": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": "Online status"
          },
          "justify": "auto",
          "nullFormat": {
            "includeNullStrings": false,
            "nullFormatValue": "",
            "strict": false
          },
          "number": "value",
          "numberFormat": "0,0.##",
          "progressBar": {
            "bar": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "max": 100,
            "min": 0,
            "track": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "value": {
              "enabled": true,
              "format": "0,0.##",
              "justify": "center",
              "style": {
                "classes": ""
              }
            }
          },
          "render": "view",
          "resizable": true,
          "sort": "none",
          "sortable": true,
          "strictWidth": false,
          "style": {
            "classes": ""
          },
          "toggleSwitch": {
            "color": {
              "selected": "",
              "unselected": ""
            }
          },
          "viewParams": {
            "input": "value"
          },
          "viewPath": "Templates/showBooleanInTable",
          "visible": true,
          "width": ""
        },
        {
          "align": "center",
          "boolean": "checkbox",
          "dateFormat": "MM/DD/YYYY",
          "editable": false,
          "field": "unitCode",
          "filter": {
            "boolean": {
              "condition": ""
            },
            "date": {
              "condition": "",
              "value": ""
            },
            "enabled": false,
            "number": {
              "condition": "",
              "value": ""
            },
            "string": {
              "condition": "",
              "value": ""
            },
            "visible": "on-hover"
          },
          "footer": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": ""
          },
          "header": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": "Unit Number"
          },
          "justify": "auto",
          "nullFormat": {
            "includeNullStrings": false,
            "nullFormatValue": "",
            "strict": false
          },
          "number": "value",
          "numberFormat": "0,0.##",
          "progressBar": {
            "bar": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "max": 100,
            "min": 0,
            "track": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "value": {
              "enabled": true,
              "format": "0,0.##",
              "justify": "center",
              "style": {
                "classes": ""
              }
            }
          },
          "render": "auto",
          "resizable": true,
          "sort": "none",
          "sortable": true,
          "strictWidth": false,
          "style": {
            "classes": ""
          },
          "toggleSwitch": {
            "color": {
              "selected": "",
              "unselected": ""
            }
          },
          "viewParams": {},
          "viewPath": "",
          "visible": true,
          "width": ""
        },
        {
          "align": "center",
          "boolean": "checkbox",
          "dateFormat": "MM/DD/YYYY",
          "editable": false,
          "field": "Type",
          "filter": {
            "boolean": {
              "condition": ""
            },
            "date": {
              "condition": "",
              "value": ""
            },
            "enabled": false,
            "number": {
              "condition": "",
              "value": ""
            },
            "string": {
              "condition": "",
              "value": ""
            },
            "visible": "on-hover"
          },
          "footer": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": ""
          },
          "header": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": "Unit Type"
          },
          "justify": "auto",
          "nullFormat": {
            "includeNullStrings": false,
            "nullFormatValue": "",
            "strict": false
          },
          "number": "value",
          "numberFormat": "0,0.##",
          "progressBar": {
            "bar": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "max": 100,
            "min": 0,
            "track": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "value": {
              "enabled": true,
              "format": "0,0.##",
              "justify": "center",
              "style": {
                "classes": ""
              }
            }
          },
          "render": "auto",
          "resizable": true,
          "sort": "none",
          "sortable": true,
          "strictWidth": false,
          "style": {
            "classes": ""
          },
          "toggleSwitch": {
            "color": {
              "selected": "",
              "unselected": ""
            }
          },
          "viewParams": {},
          "viewPath": "",
          "visible": true,
          "width": ""
        },
        {
          "align": "center",
          "boolean": "checkbox",
          "dateFormat": "DD MMM YYYY HH:mm:ss",
          "editable": false,
          "field": "lastUpdate",
          "filter": {
            "boolean": {
              "condition": ""
            },
            "date": {
              "condition": "",
              "value": ""
            },
            "enabled": false,
            "number": {
              "condition": "",
              "value": ""
            },
            "string": {
              "condition": "",
              "value": ""
            },
            "visible": "on-hover"
          },
          "footer": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": ""
          },
          "header": {
            "align": "center",
            "justify": "left",
            "style": {
              "classes": ""
            },
            "title": "Last data received"
          },
          "justify": "auto",
          "nullFormat": {
            "includeNullStrings": false,
            "nullFormatValue": "",
            "strict": false
          },
          "number": "value",
          "numberFormat": "0,0.##",
          "progressBar": {
            "bar": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "max": 100,
            "min": 0,
            "track": {
              "color": "",
              "style": {
                "classes": ""
              }
            },
            "value": {
              "enabled": true,
              "format": "0,0.##",
              "justify": "center",
              "style": {
                "classes": ""
              }
            }
          },
          "render": "auto",
          "resizable": true,
          "sort": "none",
          "sortable": true,
          "strictWidth": false,
          "style": {
            "classes": ""
          },
          "toggleSwitch": {
            "color": {
              "selected": "",
              "unselected": ""
            }
          },
          "viewParams": {},
          "viewPath": "",
          "visible": true,
          "width": ""
        }
      ],
      "pager": {
        "options": [
          25,
          50,
          100,
          250,
          500
        ],
        "activeOption": 100
      }
    },
    "meta": {
      "name": "Table"
    },
    "position": {
      "grow": 1,
      "basis": "400px"
    },
    "custom": {},
    "propConfig": {
      "props.data": {
        "binding": {
          "config": {
            "path": "view.params.inputDataset"
          },
          "type": "property"
        }
      }
    },
    "events": {
      "component": {
        "onRowDoubleClick": {
          "config": {
            "script": "\tselectedUnit = self.props.selection.data[0].unitCode\n\ttagPath = \"\" \n\tdataset = self.props.data\n\tpyData = system.dataset.toPyDataSet(dataset)\n\tfor row in pyData:\n\t\tif str(row['unitCode']) == selectedUnit:\n\t\t\ttagPath = row['tagpath']\n\t\t\tbreak\n\n\n\tsystem.tag.writeBlocking([\"[eco]selectedUnit\"], tagPath)\n\tsystem.perspective.navigate('/Unit details')"
          },
          "scope": "G",
          "type": "script"
        }
      }
    }
  }
]

Shameless bump, has anyone else experienced this?

I’m planning on replacing this table alltogether by a new table component, but would like to learn what I could have done for this jump to happen.

It is because you have props.virtualized set to false. Set it to true. I don't have the explanation for why that is the case sadly.

Bonus: For your action script, you can access the row's data you clicked with event.row instead of looping through the dataset like you are currently.

Edit: They explain some of the quirks with virtualization here

1 Like

Firstly: Thank you!

I’ve switched Virtualized on, given it a quick test and it seems like this worked.

While enabled, the table will only be populated with a smaller subset of data

I think this line threw me off - I thought the data property would have only the smaller subset, but I never checked further than that.

Bonus: I’ve also switched out the loop, and added the following row:

	tagPath = pyData[event.row]['tagPath']

This works as well!

Thank you for your reply, I’m glad I hadn’t swapped out the table with a new table component yet (since it wouldn’t have changed a thing).

P.S. it’s good to see the gnome child.

2 Likes

homage to the past, great times.

Maybe someone that knows the workings of the Table Component knows why that's the case with virtualization and row selection and could add to this topic eventually.

1 Like