Add Field with Pop-up Form bot do-not allow edit on Grid

QuestionsAdd Field with Pop-up Form bot do-not allow edit on Grid
Michael Sheppard asked 5 years ago

I would like to be able to have a field with a drop-down list that can only be ADDED with the Pop-Up form but cannot be edited on the GRID.

I have tried the following and it does-not work;

$col[“show”] = array(“list”=>true, “add”=>true, “edit”=>false, “view”=>true, “bulkedit”=>false);

This is a drop-down field as well – that looks-up the values from a query.

 

Thanks for any help you can offer

 

5 Answers
Abu Ghufran Staff answered 5 years ago

I am unable to generate this issue. Check video and code.

Code: https://gist.github.com/acdbc13dbb0282e534812584ebc2098d (line 112)

Screen: https://live.staticflickr.com/65535/49628000857_5fa738b08f_o.gif

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Michael Sheppard answered 5 years ago

Sorry – I wasn\’t very clear. It need to be able to edit SOME of the fields – so I have inline editing turned on for 3 columns but I only want to be able to add certain fields and not edit them after they have been added.

Abu Ghufran Staff replied 5 years ago

I still don’t understand. Please share screenshot to explain futther.

Michael Sheppard answered 5 years ago

Yes – it sounds confusing. I am adding a new ID record with a “SKILL”. I need to be able to add a new record but only want to change the dates – not the Employee ID or skill.

See attached screen shot. I need to be able to add a record with two key fields – but I don’t want anyone being able to EDIT those fields once the record is created. So add-only, no edit on two fields – add or edit on the other fields. Yes – confusing. This is to avoid users changing key-data after the record has been created.

The edit is being done inline, not with the pop-up form.

https://imgur.com/a/LGHkFx9

Abu Ghufran Staff replied 5 years ago

I understand now. Will be updating you back.

Abu Ghufran Staff answered 5 years ago

Apologies for the delay. It took a lot of time.

We figured out it is doable in existing build as well.

In non-editable column, along with following:
$col[“show”] = array(“list”=>true, “add”=>true, “edit”=>false, “view”=>true, “bulkedit”=>false);

You need to add this as well:
$col[“editrules”][“readonly”] = true;

This will make it non-editable (readonly) inline while available  in add dialog.

PS: Ideally the first line should suffice for both dialog and inline. We’ll be review it.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Mike answered 5 years ago

That works – thank you for the reply! That solves a pretty big issue for us.

 

Thanks! Have a great day!

Your Answer

3 + 4 =

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?