How to disable elements at background when preloader is running in Framework7 mobile App

519 Views Asked by At

I have mobile app where user can send message. I am showing preloader as Sending... when user clicks on send button. At the same time I want to make all background elements disable so that user will not able to click again until first message is delivered. I can do with Jquery to disable on beforeSend and enable it in success event of ajax. But I have more than 4 buttons on form and there are multiple such forms. I want to disable it when preloader is running on screen. Please Help!

2

There are 2 best solutions below

0
On

make them unclickable when preloader is running:

button.setEnabled(false);

or from xml:

android:enabled="false"
0
On

Use the modal indicator or preloader modal, it already disables the background view for you until your actions are done:

http://framework7.io/docs/modal.html#preloader-modal

enter image description here