Question

I have an app that has to send bulk email to selected users. I need to display my users table with a checkbox per row and a submit button with a form handler to operate on checked rows. Considering the built-in features of GC like the filter and column sorting, pagination, etc... I thought using GC would be a good solution. I found info on adding the checkbox. How do I add a submit button and form handler? Anyone have a hint or two where to start?

Was it helpful?

Solution

There are several ways to do this. I will explain two ways here.

Create the checkbox, for the id value use some unique data of the user details such as userid or username. After that on change of check box selection call a javascript method to update the hidden field with the current status. You can use some special delimiter to separate the check boxes. Let say if check box with id 1,5,6 are checked then the hidden field should be updated to "1#5#6". In the server side you can use the explode method to make an array and then you will have the usernames in array.

Another way is using AJAX and processing it immediately. I have used this way on my Codeigniter Code Generator at http://www.thephpcode.com to update the user roles' permissions. An admin user can grant or revoke permissions to a user role. All the permissions will be displayed with check box and with current status. When changed it will be updated immediatly through AJAX call.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top