javascript - append new criteria to actual search url during paging -


i having hard times append new criteria existing url

say, have url after search-submit:

/found_items/?state=bla&score=bla 

and in result page, have paginator, want if click on next button, url above should remain , new ?page=number should appended url.

<a href="?page={{ locs.next_page_number }}">next</a> 

what happening is, /found_items/?state=bla&score=bla disappearing , becoming /?page=number.

i want this: /found_items/?state=bla&score=bla&page=numer

how can this?

doniyor,

i believe may want add other parameters url when page first loads, , can set state , score in view populates values in rendered url. can set defaults state , score in view when visitor first comes page.

<a href="{% url 'name_of_view' %}?page={{ locs.next_page_number }}&state={{ state }}&score={{ score }}">next</a> 

or, if parameters may different different renderings of page, create query string in view , pass whole thing anchor tag. (the query_parameters variable created view)

<a href="{% url 'name_of_view' %}?{{ query_parameters }}">next</a> 

there few other ways this, how i've handled similar situations.

i hope helps, joe


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -