Export function is disabled in read-only mode

QuestionsExport function is disabled in read-only mode
pcatt asked 2 years ago

I’m trying to allow users to export to CSV in read-only mode.  Would seem to make sense that a user should be allowed to export since it is a read-only operation.

When I set the grid option to read-only, using:

 

$opt[“readonly”] = true;

 

Users can no longer export.  That is, the export button has disabled.

Is there a way to re-enable exporting in read-only mode?

Thanks.

3 Answers
pcatt answered 2 years ago

I’ve hacked this by editing the lib/inc/jqgrid_dist.php file, on line 1027 which start with:

if (isset($this->options[“readonly”]) && $this->options[“readonly”] === true)

 

It would be nice if there was an option to do this, though.

 

 

Abu Ghufran Staff replied 2 years ago

It’s added in dev line now and will be a part of next build.
Thanks for reporting.

Mike answered 2 years ago

I don’t have this issue. I only set-up add/edit/clone as-necessary.

I don’t use readonly = true in the Grid options, for me it’s not necessary as long as I set the Row-Actions section.

For me, reports are not read/write unless I set these options.

I then use the Read-only setting on a column-by-column basis if I only want some columns to be read/write.

Thanks

MIke

—————-8<—————————-

$g->set_actions(array(
“add”=>false,
“edit”=>false,
“clone”=>false,
“bulkedit”=>false,
“delete”=>false,
“rowactions”=>false,
“export_csv”=>true // export csv button
)
);

 

pcatt answered 2 years ago

Yep, that makes sense.  I was hoping to use the global option though.  My hack seems to work for now.

 

Thanks in any case for your reply.

Your Answer

13 + 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?