Hi,
I have a detail view screen for a table holding date fields.
Each field is accompanied by two icons: a trash icon and a calendar icon.
I would like to remove the trash icon because the dates are mandatory.
Does anyone have a clue to accomplish that?
remove trash icon from date field in DV
Re: remove trash icon from date field in DV
You are right, default date picker (combination of three
In many situations this makes sense to me, because it is faster to click that button instead of selecting empty option three times.
Anyway, you can use the following Javascript code for hiding the date-clear-button:
Before
Javascript Code
After
---
PS: Just in case someone also wants to hide the Calendar-button:
---
PPS: In case you want to hide all date-clear-buttons in a DV at once, you can use this:
Hope this helps.
<select/>
-boxes) shows date-clear-button, even if the field is required. In many situations this makes sense to me, because it is faster to click that button instead of selecting empty option three times.
Anyway, you can use the following Javascript code for hiding the date-clear-button:
Before
Javascript Code
Code: Select all
// file: hooks/TABLENAME-dv.js
const fieldname = "date_till";
hideDateClearButton(fieldname);
function hideDateClearButton(fieldname) {
jQuery(`.fd-date-clearer[data-for='${fieldname}']`).hide();
}
---
PS: Just in case someone also wants to hide the Calendar-button:
Code: Select all
// file: hooks/TABLENAME-dv.js
const fieldname = "date_till";
hideDateClearButton(fieldname);
hideDateSelectButton(fieldname);
function hideDateClearButton(fieldname) {
jQuery(`.fd-date-clearer[data-for='${fieldname}']`).hide();
}
function hideDateSelectButton(fieldname) {
jQuery(`#fd-but-${fieldname}`).hide();
}
PPS: In case you want to hide all date-clear-buttons in a DV at once, you can use this:
Code: Select all
// file: hooks/TABLENAME-dv.js
hideAllDateClearButtons();
function hideAllDateClearButtons() {
jQuery(`.fd-date-clearer[data-for]`).hide();
}
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + 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 25.10 + all AppGini Helper tools
Re: remove trash icon from date field in DV
Thanks for the reply.
Unfortunately it does not work.
This is what I added in the file ARCHIEFSTUK-dv.js:
Any suggestion?
Unfortunately it does not work.
This is what I added in the file ARCHIEFSTUK-dv.js:
// file: hooks/ARCHIEFSTUK-dv.js
const fieldname = "date_till";
hideDateClearButton(fieldname);
function hideDateClearButton(fieldname) {
jQuery(`.fd-date-clearer[data-for='${fieldname}']`).hide();
}
Any suggestion?
Re: remove trash icon from date field in DV
Are you sure your specific field has the same nameconst fieldname = "date_till";
date_till
as my sample field?Are there any red errors in console?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + 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 25.10 + all AppGini Helper tools
Re: remove trash icon from date field in DV
Changed fieldname to my actual fieldname "DatumArchiefstuk", but that didn't help.
Tried your clear all option. Doesn't work either.
Tried your clear all option. Doesn't work either.
Re: remove trash icon from date field in DV
I cannot see your code, so I cannot help debugging.
It works here if put into the correct file in hooks directory with correct fieldname after reload without cache.
And are you using an up-to-date version?
Is it really a
We need more information!
It works here if put into the correct file in hooks directory with correct fieldname after reload without cache.
Did you check that?Are there any red errors in console?
And are you using an up-to-date version?
Is it really a
date
field or something different, for example datetime
?We need more information!
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + 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 25.10 + all AppGini Helper tools
Re: remove trash icon from date field in DV
created a page with some pictures.
hope that helps.



hope that helps.


