jieter / django-tables2

django-tables2 - An app for creating HTML tables
https://django-tables2.readthedocs.io/en/latest/
Other
1.89k stars 428 forks source link

feature: example for checkbox selection and a submit action (e.g) adding to a basket/chart #922

Open markdoerr opened 1 year ago

markdoerr commented 1 year ago

Dear django-tables2 developers,

I am struggling adding a checkbox column for submitting the selected items to e.g. a chart/basket.

How would one submit selected table columns to a view and do something with it in django ? Could you please add an example of this to the examples - I think many would be very greatful.

Thanks

JordanHyatt commented 10 months ago

Hi there, So what we typically do is wrap the table in a form with a submit button (in the template), Once you click submit the checked boxes get added to the url as query params and you can process them as you see fit. image image image

markdoerr commented 10 months ago

Thanks @JordanHyatt, for your hint. I will test this approach.