Hi,
I am a PHP programmer but have limited experience with PHP Grid. I have a client whose database is build around PHP grid (FREE version). They would like to be able to send a bulk Email to clients based on the results of a filter in the grid. I am fairly adept at javascript and PHP. I know you can export the grid results. I also am reading the documentation on grid events. Is there some way via grid events or other API to work with the results in the grid? Can I get a more comprehensive example of how this might be achieved? I can manage the bulk Email part. I just want to understand how it may be possible to programmatically access the results of a search in the grid.
Thanks for looking.
A simple solution would be to follow ’email selected’ case of this demo:
https://www.phpgrid.org/demo/demos/editing/bulk-edit.php
Code: https://www.phpgrid.org/demo/demos/editing/bulk-edit.phps
Set event handler: line 132-133,
Email php code: 153-160
Create toolbar button: 218-227
This feature is supported in full version so i think your client need full version library. The free version is just for non-commercial / evaluation purpose.
Thank you for the information. This example should be close to what I am looking to achive. I have one followup questions if you could answer: Can I access (and send an email) to all of the results at once instead of the paginated/selected set? I want the user to be able to send an email an every row returned regardless if it on the current page in view. Thanks
Yes, Refer line 230 and 161.
This demo updated all records with a value taken from JS prompt().
You can change it accordingly.
Hi, I am working on completing this project. In your last answer the demo is updating all of the records in the table without any select query. I don’t want to update all of the records in the table, I want to update all of the records in the current queried set regardless of pagination or a select box. For example, the user types something into the search field. 150 rows are returned from the filtered query. I need to be able to work with those 150 rows returned from the query.
Thanks