Readonly permission in hooks/tablename.php doesn‘t work

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Yilmaz
Veteran Member
Posts: 32
Joined: 2013-01-24 16:58

Readonly permission in hooks/tablename.php doesn‘t work

Post by Yilmaz » 2020-06-26 19:20

Dear all,

I‘ve a user group „Finance“ where the user „max“ member of it.

In /hooks/tablename.php I‘ve edited the function tablensne_dv per JavaScript for 2 different kind of field types for readonly permissions related to the group Finance:

1. For text fields:
...
\$j('#Textfield').prop(‚readonly‘, true).....
....

2. For drop-down field:
...
\$j('#Dropdownfield').attr(‚disabled‘, true).....
....

Both points above work fine, means, if user „max“ logged in, the fields above are grey for him (not editable). So far ok!

BUT: If „max“ enter values in other fields where he has read/write permissions and click on save button all the values in both types of readonly fields are LOST! (= empty!)

How to fix this? Anyone an idea?
Kind regards

Yilmaz
Veteran Member
Posts: 32
Joined: 2013-01-24 16:58

Re: Readonly permission in hooks/tablename.php doesn‘t work

Post by Yilmaz » 2020-06-26 19:53

Correction:

The behavior with loosing data after clicking on save button happens ONLY in case of dropdown fields (tried also with date fields (days, month, year ID) like
\$j('#Datefield-dd').attr(‚disable‘, true)....
\$j('#Datefield-mm').attr(‚disable‘, true)....
\$j('#Datefield).attr(‚disable‘, true)....
—> loosing the data after saving!!!

Means wirh .prop(‚readonly‘, true)... works fine ONLY for Textfields!!

How to fix this getting work with dropdown and date fields?

Post Reply