Show field only for Add

QuestionsShow field only for Add
Davor Budimir asked 11 years ago

Hello Abu,

I have a field that I want to show on the grid, but not allow the user to edit the field. When they perform an add, then they must enter a value for the field.

What are the proper values to use to get this condition?

Regards,
Davor

6 Answers
Abu Ghufran answered 11 years ago

I am emailing you sample code.

Usage will be like …

$col["show"] = array("list"=>true, "add"=>true, "edit"=>false, "view"=>true);
$cols[] = $col;

Davor Budimir answered 11 years ago

This works great except if we allow "in line" edit. Then the field remains editable.

Regards,
Davor

Davor Budimir answered 11 years ago

I'm sorry, my mistake. All great works…

Regards,
Davor

Abu Ghufran answered 11 years ago

That's great. Just to help other i am posting the solution.

You can make it read only when shown on grid inline edit by following setting.
$col["editrules"] = array("required"=>true, "readonly"=>true);

Alec Clarke answered 11 years ago

I have the exact same issue. I have tried the code in this post, but the field that I want to be editable in the inline add is still read only.

Abu Ghufran answered 11 years ago

Hello Alec,

It's in the latest build that i sent earlier.
please find sample code in demos/editing/column-access.php

Regards,

Your Answer

0 + 5 =

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?