Tony Wolsey asked 8 months ago

Hello Is it possible with a setting to easily make an entire grid read only?  Only want to allow readonly access based on user permissions. thanks Tony

4 Answers
Abu answered 8 months ago

You can try setting:

$opt[“readonly”] = true;
// …

Let me know if you mean something else.

Tony Wolsey answered 8 months ago

Hi Abu

I have tried this and the grid/fields/content are still editable unfortunately.  I am looking for a way to make all fields readonly/uneditable on a page but still allow the autofilters, overall filtering, sorting and exporting to still work.

Sort of like protecting a page and allowing some visitors to only be able to view, filter, sort and export.



Tony Wolsey answered 8 months ago

Hi Abu

Any other ways to make this work?



Tony Wolsey answered 8 months ago


Just wanted to let you know that I figured out a solution for those who are interested.

I set two variables called $useraccess and $readonlyvar  based on user permissions for a page. I set the pages actions with $useraccess and each field’s “editrules readonly” parameter with the $readonlyvar variable. When the user accesses a page, if they only have permissions as a readonly user, many features will be hidden from them and each field will only be readonly/uneditable and appear as text in each field.”  They still have the ability to filter, sort, view, advanced filter, export, etc.


“inline”=>true, // allow/disallow inline
“add”=>$useraccess, // allow/disallow add
“edit”=>$useraccess, // allow/disallow edit
“delete”=>$useraccess, // allow/disallow delete
“rowactions”=>true, // show/hide row wise edit/del/save option
“export_excel”=>true, // export excel button
“bulkedit”=>$useraccess, // allow/disallow edit
//”export_pdf”=>true, // export pdf button
“export_csv”=>true, // export csv button
“autofilter” => true, // show/hide autofilter for search
“showhidecolumns” => true, // show/hide columns
“search” => “advance”, // show single/multi field search condition (e.g. simple or advance)
“import” => $useraccess,
“clone”=>$useraccess // allow/disallow clone


$col[“editrules”] = array(“required”=>true,”readonly”=>$readonlyvar); // and is required

Your Answer

2 + 7 =

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 5 / 5. Vote count: 2

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?