Changing select on active grid

QuestionsChanging select on active grid
Jim Varrone asked 4 years ago

Is there a way for me to create a button, or a drop down list, for changing the select criteria of an active grid? For example, my default select is to get everything from the database: $g->select_command = “SELECT *
from appform”.

What I want to do is to create some different SQL queries which could be applied to the active grid. One example might be:
“select * from appform where status = ‘InProcess’ and ISNULL(comments)”

 

1 Answers
Abu Ghufran Staff answered 4 years ago

This demo added a checkbox on toolbar, which calls a JS function and reloads by posting ‘query’ param to server. On server, if this variable is found posted, it changes select_command query.

Demo code here: https://gist.github.com/gridphp/94590490697b97d7f1f239c89bf8c60d

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

4 + 16 =

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?