i'm developing a new web site and i want to find out a way to add a bulk delete option.
Inside the web site I have a table that show information about schedule tasks that a user create.
The table that handle this information have these columns...
| TABLE 'schedule_task' | id, name, starting_date, status
I present all the scheduled tasks in a table using AJAX. I also have a delete/edit button that send event to the back-end.
I want to add a button in this table that the user can delete multi (or all /check-all) tasks in one time.
So far i create the button "Bulk Delete"...
<button type="button" id="bulk_delete" class="btn-xs bulk_delete_button">
Bulk Delete</button>
that send an event when its clicked...
$(document).on('click', '.bulk_delete_button', function(event){
console.log('Bulk Button clicked'); });
The button send the event successful to console and i see the message when its clicked...
Console log message Bulk Delete Button
Now i add check-boxes at the left of the table so the user can delete multiple tasks at once...
Next step that i made is to create a function that (i want) to take the picks and send to the event (when the bulk delete button clicked) the id's of tasks that the user want to delete...
My try for this so far is...
function checkBox_Picks(sourse) {
check_choises=document.getElementsByName('value');
for(var i in check_choises)
check_choises[i].checked=source.checked;
return check_choises }
I try to pass the 'check_choises' that this function returns to an other function ("function results() {....} but i couldnt pass the return from a function to an other because function A(source) --> function B() )
have you any idea how i can pass the picks of the user(id of the tasks) to the Bulk Delete button?