This topic is locked
[SOLVED]

Dashboards and default focus field/element

8/2/2024 6:08:47 AM
PHPRunner General questions
R
rkgee author

Hi.

So I have a dashboard which contains a bunch of list/table views (flowing down beyond the height of the web browser) - some of which have a relationship with the top-most list/table. When I select a row in the top list, all the records in related tables below repopulate as is expected. The problem is that the web-browser focus jumps to an element (the edit record pencil icon) in the bottom table/list which means that the user needs to scroll right back up to the top of the page again before selecting another row in the top table. Is there a way to direct the browser focus to remain on an element in the top table - OR focus on the simple search textbox in the top bar for example whenever a user selects a row in the top table?

Thank you

R
rkgee author 8/2/2024

I found a solution - not sure if it's the best way to do it but...

I added

document.getElementById("ctlSearchFor1").focus();

To the JavaScript OnLoad Event for each of the tables which appear further down in the Dashboard.