Page 1 of 1
Is there a way to autosave records?
Posted: 2018-04-17 20:31
by D Oliveira
Greetins, Im having some issues training older people to use the application that I have developed, they constantly forget to save the records, is there a way to set a timeout function every 5 seconds to autosave? Thank you
Re: Is there a way to autosave records?
Posted: 2018-04-17 21:53
by pbottcher
Hi,
I think you could acheive this via the setInterval(function() { YOURCODE }, TIMEOUT in millisecons). Put this in the TABLENAME-dv.js
e.g. setInterval(function() { $j('#update').click() }, 5000); where update is the button to save.
be aware that 5 seconds is quite short

.
hope that helps
Re: Is there a way to autosave records?
Posted: 2018-04-19 12:36
by D Oliveira
pböttcher wrote: ↑2018-04-17 21:53
Hi,
I think you could acheive this via the setInterval(function() { YOURCODE }, TIMEOUT in millisecons). Put this in the TABLENAME-dv.js
e.g. setInterval(function() { $j('#update').click() }, 5000); where update is the button to save.
be aware that 5 seconds is quite short

.
hope that helps
Thank you for shedding some light on the issue, can you please share with me correct 'id' of the save button ? because $j('#update) is not working, thanks in advance
Re: Is there a way to autosave records?
Posted: 2018-04-19 13:40
by pbottcher
Hi,
hmmm, in my app the save-button do all have the id=update. I tested the above and it works for me. Can you use your Browser-development console (F12 for IE, Google, Firefox) to identify the button and see your id. Also, where did you add the code to?
Re: Is there a way to autosave records?
Posted: 2018-04-19 14:57
by D Oliveira
pböttcher wrote: ↑2018-04-19 13:40
Hi,
hmmm, in my app the save-button do all have the id=update. I tested the above and it works for me. Can you use your Browser-development console (F12 for IE, Google, Firefox) to identify the button and see your id. Also, where did you add the code to?
Hey I just found small jQuery syntax error involving select2 and now it works fine, apparently that was interfering, thank you all!