Readonly fields are not updating

All ApPHP DataGrid script bugs discussion. Questions and requests here.
Please, use a $debug_mode = true; before you say "Why Nothing Works ?!" (solves 90% of all issues)

Moderator: alexandrleonenko

Do you think datagrid must automatically update "readonly" fields?

Poll ended at Jan 13th, '11, 08:35

Yes, please add such feature in the next version.
1
100%
No, it's not important
0
No votes
I don't know
0
No votes
 
Total votes: 1

kasumovic
Expert
Expert
Posts: 87
Joined: Sep 7th, '10, 22:38

Readonly fields are not updating

Postby kasumovic » Nov 11th, '10, 13:18

Hi,

I think this should be bug , and not desired behaviour.

Reason :

Sometimes i have some fields what user should see it , but they should not modify them SELF ! , that is ok "READONLY"

But ...

If some action is made in this record i must set this field like timestamp. and this field must be saved too.

regards
kasumovic

administrator
Site Admin
Site Admin
Posts: 5997
Joined: Jan 7th, '09, 23:18
Contact:

Re: Readonly fields are not updating

Postby administrator » Nov 11th, '10, 17:51

Ok, there are two things:

1. If you need to show field, nut not update it - use "readonly"
2. If you need update field - use "hidden" fields. For hiidedn fields, that must be shown - we use "visible"=>"true"

kasumovic
Expert
Expert
Posts: 87
Joined: Sep 7th, '10, 22:38

Re: Readonly fields are not updating

Postby kasumovic » Nov 11th, '10, 22:08

So far was i too :-)

BUT ...

Using this way is not practical :
Following scenario: I want to use this as timestamp , in format datatimedmy, if edit mode opens i must show this field value to my customer in form DATETIMEDMY, must save this as DATETIME back (must convert it back to y-m-d h:i:s).
Customer should not be able to change this value !

USING HIDDEN FIELD METHOD:
==========================
1.) onLoad must see that i draw the component in datetimedmy format (must create own javascript function to do this)
2.) on desired action i must change this hidden field via javascript with getelementbyid
3.) before updating must convert this DATETIMEDMY field to datetime (y-m-d h:i:s) (again must developer take care about this , work again)

USING FIELD WITH "TYPE"=>"DATETIMEDMY" AND "READONLY"=>"TRUE" :
==============================================================
1.) on desired action i must change this hidden field via javascript with getelementbyid (all other things works automaticaly , thanks "type=>"datetimedmy")

This was procedure for one field only , and what if i have 10 fields like this , showing percent .... :-) ?

So you see that this READONLY can be usefull only for "END-USER" to prevent that they change some value , the developer should have access to this field without any restrictions

Developer can combine so "type" property (with all formating issues and posibilities) with "readonly" property

administrator
Site Admin
Site Admin
Posts: 5997
Joined: Jan 7th, '09, 23:18
Contact:

Re: Readonly fields are not updating

Postby administrator » Nov 14th, '10, 08:26

So all what you need is to have possibility to change "readonly" field with javascript and you expect that datagrid will update this field (what doesn't happens now), right?

Find this line of code
if(!$this->IsReadonly($fldName) && !$this->IsValidator($fldName)){

in UpdateRow method and remove !$this->IsReadonly($fldName)


Return to “ApPHP DataGrid {bugs}”