Documentation

Getting Started

The jqxLoader represents a jQuery widget which displays the built-in loading element. The loading element can be icon only, text only or combination of icon and text. It can be used to display loading element until the widget's data is loaded.
Every UI widget from jQWidgets toolkit needs its JavaScript files to be included in order to work properly.

The first step is to create html page and add links to the javascript files and css dependencies to your project. The jqxLoader widget requires the following files:

<head>
<link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxloader.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head>

The next step is to create a DIV element within the body of the html document.
<div id="jqxLoader">
</div>

The last step is to initialize the widget by adding the following script to the html document:
<script type="text/javascript">
$(document).ready(function () {
$("#jqxLoader").jqxLoader({ width: 250, height: 150, autoOpen: true });
});
</script>

To call a function(method), you need to pass the method name and parameters(if any) in the jqxLoader’s constructor.
   
$("#jqxLoader").jqxLoader('open');
To set a property(option), you need to pass the property name and value(s) in the jqxLoader's constructor.
$("#jqxLoader").jqxLoader({ height: "150px" });
To get a property(option), you need to pass the property name to the jqxLoader's constructor.
var height = $("#jqxLoader").jqxLoader("height");
To bind to an event of a UI widget, you can use basic jQuery syntax. The example code below demonstrates how to bind to the "create" event of jqxLoader.
// bind to create event.
$('#jqxLoader').on('create', function () {
alert("jqxLoader is created!");
});

Basic Sample

<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery Loader Sample</title>
<link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxloader.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#openLoader").jqxButton({
width: 150
});
$("#jqxLoader").jqxLoader({ width: 250, height: 150 });
$('#openLoader').on('click', function () {
$('#jqxLoader').jqxLoader('open');
});
$("#closeLoader").jqxButton({
width: 100
});
$('#closeLoader').on('click', function () {
$('#jqxLoader').jqxLoader('close');
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head>
<body>
<div id="jqxLoader">
</div>
<input type="button" value="Open Loader" id="openLoader" />
<input type="button" value="Close" id="closeLoader" />
</body>
</html>

The result of the above code is: