Author Topic: loadstate from url  (Read 2269 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
loadstate from url
« on: February 10, 2020, 03:48:31 pm »
Trying to load state from query param...but it doesn't seem to work.
Also how can I set the loaded state as choosen in the states dropdown?

https://jsfiddle.net/queensgambit9/59n0bdLa/12/

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: loadstate from url
« Reply #1 on: February 11, 2020, 09:59:56 am »
Sorry, it's not clear from the jsfiddle how you are trying to load state from a url.

Please share a sample url from which you are attempting to load state. Does url contain all the state data?
« Last Edit: February 11, 2020, 01:19:19 pm by paramvir »

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: loadstate from url
« Reply #2 on: February 11, 2020, 05:06:09 pm »
No, Im trying to load an existing state from query param.
Ex, a state named 'test' exist in local storage.

I would then like to load it when query param is used: www.example.com?state=test

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: loadstate from url
« Reply #3 on: February 11, 2020, 07:37:41 pm »
Btw, is it possible to share states by query params or any other way?
So that you can create a state and then send a link so that users can have same layout etc?
« Last Edit: February 11, 2020, 07:39:48 pm by queensgambit9 »