Read only when edit record

QuestionsRead only when edit record
Alfonso Cabrera asked 5 years ago

Hi Abu!

I would like to know how to make my ui controls editable when I add a record, not when I edit a row.

I use the [editrules]=[readonly]

But when I want to add a record I canĀ“t add information.

1 Answers
Abu Ghufran answered 5 years ago

Setting readonly with desired column should work:

$col["editrules"]["readonly"] = true;

e.g.

$col = array();
$col["title"] = "Gender";
$col["name"] = "gender";
$col["editable"] = true;
$col["editrules"] = array("required"=>true, "readonly"=>true);
$cols[] = $col;

Editable when add.
Readonly when edit.

Demo code: http://hastebin.com/evepirozad.php

Your Answer

18 + 19 =

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?