jbusy JBusy extension, javascript utility to show or hide animated activity / busyness indicator

  1. Documentation
  2. Change Log

This extension is a yii wrapper to use easily the jbusy plugin.

It provides an easy way to show / hide an image instead of an html element (mainly used with ajax to show activity during data transfer).

jbusy image

Resources

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions
Usage

See the following code example:

Yii::import('ext.jbusy.JBusy');

// create the busy object
$busy = new JBusy();

// create an ajax request array based on a jquery selector or a widget instance
// this will create beforeSend and complete javascript function to pass to $.ajax.
$ar = $busy->createAjaxArray('#plot1');

// merge with your options
$ajax = array_merge($ar, array(
	'url' => 'my_data.php',
	'success' => 'js:function() { alert("well done."); }',
	'error' => 'js:function() { alert("an error occured."); }'
));

// register the ajax script
Yii::app()->clientScript->registerScript('ajax1', '$.ajax('.CJavaScript::encode($ajax).')');

With this code, the html element with id plot1 will be replaced by an animated image during the retrieving of my_data.php file.

Change Log

September 16, 2010
  • Initial release.
2 0
4 followers
443 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Tags:
Developed by: Parcouss
Created on: Sep 16, 2010
Last updated: 13 years ago

Downloads

show all