I'm not sure, but I think you might be asking how to have the products
deleted immediately when you check the box?
There are two aspects to this process.
1) Deleting the product record from a database on the host
2) Deleting the entry on the screen

For 1) you will need to somehow put an onClick handler on each
checkbox Input.
You can do this directly in your view, but you will need to also have
the handler javascript accessed by your page.
You can also do this with some startup javascript code.
Once you are in the handler, there are two approaches.
First you could 'submit' the form yourself to the page controller.
This controller would do the database delete, and refresh the entire
page.
This might be a little disconcerting as well as time consuming for the
user if they have to delete a number of products.
After each check they would need to wait for the refresh.
An alternative is to use the xmlhttp object (aka Ajax).
To do this, you would send a product ID to a special controller.
The controller would delete the product, and send some kind of
confirmation message back.
This all requires some fancy javascript, but there is plenty of
documentation around, and plenty of libraries that will help you.

2) If each delete above causes a page refresh, then there is nothing
to do here.  The refreshed page will appear without the deleted
product.
If you are taking the Ajax route, you have two choices.   Delete the
product entry when you send the delete request, or when the result
comes back.
In either case, it is a matter of manipulating the DOM structures to
remove the product from your page.   If you have questions about how
to do this, or integrating it into Cake, you are welcome to email me
directly.   Most of this really is not a Cake matter.


On Nov 7, 4:34 pm, dandreta <[EMAIL PROTECTED]> wrote:
> Hello!
> I have in my view a list of products, each one with a checkbox to the
> side and a link (Remove Selected Products) at the end of the page. The
> question is that I want that on click the link all the marked products
> will be removed. How I would do my function in the controller in order
> that it receives the ids of the marked products  and remove them into
> the database?
> Do you know any article or link relating to this?
> I am inexpert in cakephp and my verion of cake is 1.2.
> Thanks and regards.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to