Make a Dropdown selection box read only in edit dialog

QuestionsMake a Dropdown selection box read only in edit dialog
Richard Samson asked 2 years ago

Hi Folks,
 
Is it possible to make the dropdown selection box read only in the edit dialog, but work normally within the add new record dialog?  I’d like my users to be able to add new records, but once added not be able to edit the drop down column.  The column needs to be visible within the edit dialog but locked so it can’t be changed.
 
Alternatively, is it possible to show virtual columns within the edit dialog?
 
Thanks,

1 Answers
Abu Ghufran Staff answered 2 years ago

You can also set certain column as readonly on edit dialog, and editable on add dialog.
$col[“editrules”][“readonly”] = true;
Creating a new virtual column is also doable, and display it only on edit dialog.
$col[“show”][“add”]=false;
$col[“show”][“edit”]=true;

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Richard Samson replied 2 years ago

Thanks. The first option worked fine, not sure how I missed that.

Ref the virtual column, I still can’t get that one to show in the edit dialog unless I set editable=true, but as soon as I do that I receive SQL errors when updating the record as the field doesn’t exist in the target table.

Your Answer

16 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?