Giter VIP home page Giter VIP logo

Comments (6)

Sangvinikis avatar Sangvinikis commented on September 25, 2024

My temp solution:
function storage() { sessionStorage.removeItem('my-storage'); location.reload(); }
my-storage same value as storageName
storage() as onclick button

If there is better option, please comment :)

from jplist-es6.

1rosehip avatar 1rosehip commented on September 25, 2024

Could you please recreate your scenario in https://codepen.io/ or other service so i could check this?

from jplist-es6.

NateGGC avatar NateGGC commented on September 25, 2024

Im also having this issue with deep linking. It works when the option is removed but with deep linking true, nothing happens.

from jplist-es6.

burkybang avatar burkybang commented on September 25, 2024

I know this is old, but I wanted to provide the solution for those who need it since it wasn't actually resolved here.

The reason this is a problem is because it's not clearing the storage before resetting the fields. After it resets the fields, it first reads from the storage, and then it sets the fields from the storage. You need to clear the storage first.

For Session Storage

sessionStorage.removeItem('my-storage');
jplist.resetControls();

For Deep Linking

location.hash = '';
jplist.resetControls();

from jplist-es6.

pmacswebteam avatar pmacswebteam commented on September 25, 2024

Hi @burkybang thanks for this help. We are having the same issue with deep linking. Can you please confirm where

location.hash = '';
jplist.resetControls();

should be put/how it should be used to get the reset working?

Thanks!

from jplist-es6.

burkybang avatar burkybang commented on September 25, 2024

@pmacswebteam No prob! It would go in a function for an onclick event just like @Sangvinikis said above.

Here are some examples of ways to achieve this:

<button type="button" onclick="location.hash=''; jplist.resetControls();">

Or:

<button type="button" onclick="resetControls();">Reset Controls</button>

<script type="text/javascript">
function resetControls() {
  location.hash = '';
  jplist.resetControls();
}
</script>

Or with jQuery:

<button type="button" id="reset-controls">Reset Controls</button>

<script type="text/javascript">
$('#reset-controls').on('click', function() {
  location.hash = '';
  jplist.resetControls();
});
</script>

from jplist-es6.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.