1rosehip / jplist

jPList jQuery Data Grid Controls is a flexible jQuery plugin for sorting, pagination and filtering of any HTML structure (DIVs, UL/LI, tables, etc).
http://jplist.com
Other
437 stars 176 forks source link

Use ? as hashStart on deeplink #280

Closed justijndepover closed 4 years ago

justijndepover commented 7 years ago

I'm building a website to sell products. In the overview I use jplist to filter the products. I have deeplink enabled so it's possible to share the urls with filters, etc...

If I leave the hashStart symbol to the default # and navigate to the detail of a product (actual reload) my php variable $_SERVER['HTTP_REFERER'] does not contain the filtering parameters from the url.

If i change the hashStart symbol to ? the $_SERVER['HTTP_REFERER'] contains the correct parameters. However if I load that url the plugin does not recognise the params and resets them.

So:

Let's say I clicked the second page then my url is the following:

http://www.domain.com/products#paging:currentPage=1|paging:number=9

If i navigate to a detail my $_SERVER['HTTP_REFERER'] is:

http://www.domain.com/products

If i change the hashStart and redo the previous i get: actual domain:

http://www.domain.com/products?paging:currentPage=1|paging:number=9

referer:

http://www.domain.com/products?paging:currentPage=1|paging:number=9

which is good! But if i open

http://www.domain.com/products?paging:currentPage=1|paging:number=9

The plugin forgets the parameters and changes the url to

http://www.domain.com/products?paging:currentPage=0|paging:number=9

So i lose all my states (selected filters, selected page, ... )

How can I solve my problem?