javascript - HTML5 localStorage usage -


i have huge form intend quality assurance personnel use offline in collection of data annual product quality reviews. because of complexity of regulatory requirements form contains on 1900 fields , radio-buttons.

i have invoke localstorage via sisyphus.js , it's working - saving data fields fine.

my problem in loading takes 7 seconds form finish loading - granted it's long time - that's not real issue. real problem after making entry takes little on 2 seconds after onblur event form accept more input.

here code:

$('form').sisyphus({     locationbased: false,     timeout: 10,     autorelease: false }); 

my question: there way invoke storage of data @ discretion of user, perhaps button, or other method, in order prevent constant interruptions in data entry?

anyone have ideas?

the plugin you're using (sisyphus.js) doesn't seem have been written handling "large" amount of fields.

if @ source:

https://raw.githubusercontent.com/simsalabim/sisyphus/master/sisyphus.js

you'll see there's method savealldata. coupled bindsavedataonchange method, it's saving fields every time field changed.

and, if wasn't case, you'd still 2 second lag every 10 seconds (timeout option).

a quick fix, i'd hope, fork/modify or override plugin null out bindsavedataonchange method, , implement hook saving form data on button click. and, perhaps, removing or increasing timeout option.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -