Yii 1.1: loading

Simple widget for displaying "loading" icon/splashscreen
29 followers

You can add this widget to actions & widgets, that do some ajax requests or other continuous javascript operations and use Loading.show() and Loading.hide() for displaying pretty animated loading icon/splashscreen

Don't worry about multiple calls of this widget, it don't write any html excepting registering .js and .css files and in any case it happens once per page.

To customize it's view you can copy assets dir to your_theme_dir/LoginWidget/assets and make it looks differ.

The only sense of moving such simple script to reusable widget is a good code organizing practice and common interface.

Requirements

Yii framework 1.1+

JQuery

Usage

In views/layouts:

$this->widget('ext.widgets.loading.LoadingWidget');

In javascript:

Loading.show();
Loading.hide();

Total 6 comments

#16800 report it
Stefano Mtangoo at 2014/03/29 04:25pm
No need for demo

Because its so simple. Put Javascript code on button event or Ajax and you are good to go.

Here is sample (uses Yiistrap but is not hard to understand)

<?php $this->widget('ext.widgets.loading.LoadingWidget'); ?>
 
       <?php 
 
         echo TbHtml::submitButton( 'Click Me!',array(
            'color'=>TbHtml::BUTTON_COLOR_DEFAULT,
            'size'=>TbHtml::BUTTON_SIZE_DEFAULT,
            'onClick'=>'Loading.show(); return false;'
         )); ?>
#7870 report it
bennouna at 2012/04/24 05:56am
An alternative

I like how this extension is non-obtrusive, portable, and DRY. Thanks, I should try it some day.

#7190 report it
Yureshwar Ravuri at 2012/03/02 07:14am
Describe detailed usage of this extension

Can you please elaborate on how to use this extension. Can't figure it out.

#6981 report it
teguh11 at 2012/02/16 10:03pm
use

how to use this extension?

#6669 report it
Ivan Wilhelm at 2012/01/27 09:26am
Great

Great extension, i use in all my projects!! :D

#5216 report it
sensorario at 2011/09/22 03:23pm
No demo page?

There isn't any demo page =(.

Leave a comment

Please to leave your comment.

Create extension