Hi,
how can I prevent AG from putting the focus on the first field in the details table view?
There must be a very simple way - which I have not found yet
Thanks already
Olaf
How to? Not focus first field in details view?
How to? Not focus first field in details view?
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: How to? Not focus first field in details view?
On document ready call the focus() method like $j("#fieldname").focus();
This will work for normal input fields if they already have been rendered.
But there may be some built in function doing the same for the first field a little bit later.
This will work for normal input fields if they already have been rendered.
But there may be some built in function doing the same for the first field a little bit later.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to? Not focus first field in details view?
Hi Jan,
I tried this code in the beginning of hooks/tablename-dv.js
(Same with your line of code)
Unfortunately AG seems to jump back to the field. Notice in the image, that first the back button (zurück) is focused, but then the focus jumps back to the first form field.(Dark start of image as I am refreshing the page). Olaf
I tried this code in the beginning of hooks/tablename-dv.js
Code: Select all
$j(function() {
document.querySelector("#deselect").focus();
});
Unfortunately AG seems to jump back to the field. Notice in the image, that first the back button (zurück) is focused, but then the focus jumps back to the first form field.(Dark start of image as I am refreshing the page). Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: How to? Not focus first field in details view?
You are right, I was afraid there is something like this inside for a while now.
Please try to disable AppGini's default behaviour with the following javascript code in TABLENAME-dv.js:
You should be able to implement your own focus-function now, for example:
Please try to disable AppGini's default behaviour with the following javascript code in TABLENAME-dv.js:
Code: Select all
AppGini.focusFirstFormElement = function() { /*noop*/ };
Code: Select all
$j(function() {
$j("#deselect").focus();
});
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to? Not focus first field in details view?
Hi Ja,
as always: Perfect solution.
In my case your one-liner was enough, as I just needed to remove the focus.
Thank you very much
Olaf
as always: Perfect solution.
In my case your one-liner was enough, as I just needed to remove the focus.
Thank you very much
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: How to? Not focus first field in details view?
Hi,
I tried it and unfortunately it didn't work in my case (?) so I changed the following line in my templateDV:
from: setTimeout(AppGini.focusFirstFormElement, 1500);
to: setTimeout(AppGini.focusFirstFormElement, 150000);
and whilst that means editing the templateDV file each time (or write protecting it to preserve the change on generating appgini project) it works for me. Is there a way to globally change the timeout for auto focusFirstFormElement ?
Cheers,
Ron
I tried it and unfortunately it didn't work in my case (?) so I changed the following line in my templateDV:
from: setTimeout(AppGini.focusFirstFormElement, 1500);
to: setTimeout(AppGini.focusFirstFormElement, 150000);
and whilst that means editing the templateDV file each time (or write protecting it to preserve the change on generating appgini project) it works for me. Is there a way to globally change the timeout for auto focusFirstFormElement ?
Cheers,
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: How to? Not focus first field in details view?
My Bad!
It does work for me now, seems I didn't have clear cached images and files checked in my Chrome browser to clear in my default settings.
Cheers,
Ron
It does work for me now, seems I didn't have clear cached images and files checked in my Chrome browser to clear in my default settings.
Cheers,
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: How to? Not focus first field in details view?
Hi Ron,
thanks for reporting back. When reading your 150,000 value - which equals 150 seconds something seemed strange to me. Glad, that you found your solution.
Olaf
thanks for reporting back. When reading your 150,000 value - which equals 150 seconds something seemed strange to me. Glad, that you found your solution.
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: How to? Not focus first field in details view?
Clearing the cache is extremely important when programming Javascript. There are keyboard shortcuts for every browser.
If you are interested, you may have a look here:
https://appgini.bizzworxx.de/support/troubleshooting/
The first box of my troubleshooting guide lists the keyboard shortcuts for clearing cache + reloading the current page in most popular browsers.
Annotation: Almost every day users are asking me for support on javascript bugs they have. It happened to me that a few of them even got angry with me (?!) although I was trying to help them (for free by the way) to narrow down their problems. And sometimes, after spending too much time on searching for bugs, a simple CTRL+R "fixes" their "bugs". I really recommend getting used to using the keyboard shortcuts. It will save you hours on searching for bugs which do not exist.
If you are interested, you may have a look here:
https://appgini.bizzworxx.de/support/troubleshooting/
The first box of my troubleshooting guide lists the keyboard shortcuts for clearing cache + reloading the current page in most popular browsers.
Annotation: Almost every day users are asking me for support on javascript bugs they have. It happened to me that a few of them even got angry with me (?!) although I was trying to help them (for free by the way) to narrow down their problems. And sometimes, after spending too much time on searching for bugs, a simple CTRL+R "fixes" their "bugs". I really recommend getting used to using the keyboard shortcuts. It will save you hours on searching for bugs which do not exist.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools