View only, no edit

QuestionsView only, no edit
Daniel asked 11 years ago

I'm looking for a gridview that can show (with all features like search, filter, export,…) data from a Mysql view (no table)
There will be no primary key, no insert,…
Is this possible with this grid control?

1 Answers
anavarro answered 11 years ago

Yes, that's possible with PHPGrid.

Since your view doesn't have a PK, I sugest that you define your select in the select command like this:

SELECT @id := @id + 1 AS rowid, v.*
FROM viewname v JOIN (SELECT @id := 0) as foo

With that, your select will auto numerate your rows, creating an id for each row in your view.

And in your set_actions use this:

$g->set_actions(array(
"add"=>false,
"edit"=>false,
"delete"=>false,
"rowactions"=>false,
"export"=>true,
"view"=>false,
"autofilter"=>true,
"search"=>"advance")
);

Your grid will not have an add, edit or delete options, just the search and filter options.

Your Answer

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