rkaartikeyan
rkaartikeyan

Reputation: 2007

How do i use Phonegap's WaitingDialog Plugin in my project

https://github.com/guidosabatini/phonegap-plugins/tree/master/Android/WaitingDialog

I found this Waitling Dialogue Plugin for Phonegap. But i don't know how to use this, i mean where to put the files?

So please help me to solve this issue.

Upvotes: 1

Views: 1529

Answers (1)

fida1989
fida1989

Reputation: 3249

Download and put the WaitingDialog.java inside main package in src.

Then download and include the WaitingDialog.js file in your in the html file. Something like the following:

Then call necessary functions:

// To SHOW a modal waiting dialog

window.plugins.waitingDialog.show("Your dialog text");

// To HIDE the dialog

window.plugins.waitingDialog.hide();

[I haven't tested, but hopefully it will work.]

Alternative Solution:

If you are using jQuery Mobile then another solution can be to use jquery.mobile.utils to show the loader.

Download and include the jquery.mobile.utils.js file in your html file. Then call necessary functions like below:

// Params: jqm theme swatch, and message text

$.mobile.utils.showWaitBox("a", "Hang on while I do work...");

// ... some time later...

$.mobile.utils.hideWaitBox();

[This one is tested and works fine.]

Upvotes: 2

Related Questions