Saturday, April 15, 2017

Dynamic Selector with Django/Jquery

I need to filter lists of items to be displayed upon user selection in my list view.
For instance if user selects 12 it should show only 12 products per page and so on.
My Django view has vairble items like below:

items=Items.objects.all() 
Now I need to get products as per user selection how would i do that?

<form>
<span>Show:</span>
<select class="orderby number" name="page_size">
                                               <option value="9" selected="selected">9</option>
                                               <option value="12">12</option>
                                               <option value="24">24</option>
                                               <option value="36">36</option>
                                               <option value="48">48</option>
                                               <option value="60">60</option>
                                               <option value="90">90</option>
                                               <option value="100">100</option>
</select>
</form>


Screenshot is attached. Please advise.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B8umNWjgfxZYOodsznfR08KDR745op4Yw7qV3yBK5MZqUcVBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment