webismymind / editablegrid

EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
http://www.editablegrid.net
Other
795 stars 272 forks source link

Reset filter when refresh page #129

Open capaaway opened 8 years ago

capaaway commented 8 years ago

Hi all, I would want to reset filter box when i refresh page , because automatically the browser mainain last value that I've inserted: is it possible? Thanks Fabio

v-volaju commented 8 years ago

You can add a new function let's say clearFilter to editablegrid.js with the following code

EditableGrid.prototype.clearFilter = function(){
         this.localset('filter',''); //clears the localstorage entry
        this.currentFilter='';
}

Then where you reload the page, you can put

    window.onload = function() { 
        editableGrid.onloadJSON('some-data.json'); 
           editableGrid.clearFilter(); 
    }; 
gkernan commented 7 years ago

I just called this functiion prior to calling editableGrid.renderGrid( ... editableGrid.filter("");