Risk of loosing data on slow pageload

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
casjazz
Posts: 5
Joined: 2014-09-21 14:11

Risk of loosing data on slow pageload

Post by casjazz » 2014-11-30 18:53

I have a detailview page with 14 dropdowns.
If the page loads slow (2-6 sec), the user has time to update the record before all values at loaded. The not loaded dropdowns will overwrite existing values with empty values.
Rigth now i have a script almost in the end of the _dml.php file, that activates the buttons after 1500-4500 ms. but if the page take longer to load I still have the problem.

Does anyone have an idea how to either get the selects to load faster or how to make sure that the user can't update the record before all select2() are loaded ?

Image

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: Risk of loosing data on slow pageload

Post by a.gneady » 2014-12-01 21:52

Thanks for taking the time to report this bug ... We'll make sure to fix it in the next release. For now, here is a work-around to disable the update/save new buttons during data loading: Add the following code to the file "hooks/tablename-dv.js" (where tablename is the name of the concerned table) .. you should create the file if it doesn't exist:

Code: Select all

$j(function(){
    $j(document).ajaxStart(function(){ $j('#update, #insert').prop('disabled', true); });
    $j(document).ajaxStop(function(){ $j('#update, #insert').prop('disabled', false); });
});
:idea: AppGini plugins to add more power to your apps:

casjazz
Posts: 5
Joined: 2014-09-21 14:11

Re: Risk of loosing data on slow pageload

Post by casjazz » 2014-12-02 07:45

Thank you so much - you've just saved my day :)
I've been strugglign with this for weeks, and in two hours i'm going to present my website, now without any (known) trouble :-)

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Risk of loosing data on slow pageload

Post by AhmedBR » 2016-03-30 11:10

Hi,

Was this added in a newer release, or we still have to use this trick?

Thanks and have a nice day ;)
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: Risk of loosing data on slow pageload

Post by a.gneady » 2016-03-31 12:13

Yes, it was added in recent releases. No need to add this code manually.
:idea: AppGini plugins to add more power to your apps:

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Risk of loosing data on slow pageload

Post by AhmedBR » 2016-04-01 23:50

Thanks.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

Post Reply