Export filtered issue

QuestionsExport filtered issue
c3media asked 4 years ago

Hello Abu,

 

I am trying to export in PDF with master-detail, however is not filtering the master grid.

Code: https://gist.github.com/mediac3/72547f8cb14ded9db52edc3b5471e8de

5 Answers
Abu Ghufran Staff answered 4 years ago

You can get WHERE clause currently used by this code:

$searchstr = $_SESSION[“jqgrid_list25_searchstr”];
$wh = $this->construct_where($searchstr);

And use $wh in your export sql query.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
c3media answered 4 years ago

Hello Abu,

 

Where to put this code, what line?

Abu Ghufran Staff answered 4 years ago

On line 277, where you are loading $data, you will need to comment that and run sql query and get results in $data from that.

$searchstr = $_SESSION[“jqgrid_list25_searchstr”];
$wh = $this->construct_where($searchstr);
$data = $grid->get_all(“SELECT * FROM col_enrollment_book $wh”);

I’ve not tested this code so you need to debug using print_r, die.

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
c3media answered 4 years ago

Hello sir,

 

I did it, however show CMS issue as critical and it’s not possible to debug.

 

Regards!

Abu Ghufran Staff answered 4 years ago

After some research, it was found that wordpress deletes PHP’s native $_SESSION array which was used by datagrid library.

As a way around, it is suggested to install WordPress Native PHP Sessions – WordPress plugin | WordPress.org to make it work as expected. After that $_SESSION can be used inside wordpress callback functions.

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

9 + 6 =

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?