Page 1 of 1
Put tableWindow at top of screen?
Posted: 10 April 2022, 14:23
by SteveD123
I'm using displayTableWindow in JS to display a round end summary:
Code: Select all
this.tableDlg = this.displayTableWindow( 'roundEndSummary', title, table, header, footer);
Is there a way to position this dialog window at the top of the screen instead of the middle? I tried adding:
but that gives a generic error message "Javascript error:"
Re: Put tableWindow at top of screen?
Posted: 10 April 2022, 14:50
by robinzig
SteveD123 wrote: ↑10 April 2022, 14:23
I'm using displayTableWindow in JS to display a round end summary:
Code: Select all
this.tableDlg = this.displayTableWindow( 'roundEndSummary', title, table, header, footer);
Is there a way to position this dialog window at the top of the screen instead of the middle? I tried adding:
but that gives a generic error message "Javascript error:"
Well what have you done to debug this Javascript error?
I suspect that `this.tableDlg` (ie the return value of `this.displayTableWindow`) - if it exists at all and isn't just `undefined` - will be some more complex Javascript structure, rather than the actual DOM element that you can directly set styles on. You might have to grab the dialog by ID or some more complex CSS selector (you may also be able to set the style in CSS rather than JS, which if possible might be much cleaner).
Re: Put tableWindow at top of screen?
Posted: 10 April 2022, 18:39
by SteveD123
I had previously tried:
Code: Select all
var dialog = document.getElementById('roundEndSummary');
dialog.style.top = '10px';
and got the same unhelpful error message. But it turns out the solution was to do the following
Code: Select all
var dialog = document.getElementById('popin_tableWindow');
dialog.style.top = '10px';