mobile.loader
Mobile Loader クラスは、Mobile Loader クラスプロパティを JavaScript パス、カスケード スタイル シート パスおよびリソースとして初期化することを可能にする静的オブジェクトコンポーネントを通して使用することも可能です。
このローダーが、すべてのリソースがページにロードされることを認識すると、jQuery で document ready イベントとほとんど同じように動作するコールバックが実行されます。以下のコード スニペットは、Mobile Loader 静的オブジェクトを初期化する方法を示します。
コード サンプル
<!doctype html>
<html>
<head>
<!-- jQuery Core -->
<script src="js/jquery.js" type="text/javascript"></script>
<!-- jQuery Mobile -->
<script src="js/jquery.mobile.js" type="text/javascript"></script>
<!-- Moderznizr -->
<script src="js/modernizr.js" type="text/javascript"></script>
<!-- Infragistics Loader Script -->
<script src="js/infragistics.loader.js" type="text/javascript"></script>
<!-- Infragistics Loader Initialization -->
<script type="text/javascript">
$.ig.loader({
scriptPath: "js/",
cssPath: "css/",
resources: "igmRating"
});
</script>
</head>
<body>
<div id="igRating1"
data-role="igrating"
data-value="2">
</div>
</body>
</html>
関連サンプル
関連トピック
依存関係
-
loader
- .loader( [param1:object], [param2:string], [param3:function] );
jQuery の document ready ステートメントと同様に使用できる静的オブジェクト。
コールバックは、ドキュメントが準備完了となるまで起動されません。
オプションで任意の順序で渡すことができる 3 つのパラメーターすべてを受け入れます。
実例:
1. 初期化して、以下の渡されたオプションを通してすべてを通知します:
$.ig.loader({
scriptPath: '../../../Source/ClientUI/js/',
cssPath: '../../../Source/ClientUI/css/',
resources: 'igGrid.*,igTree',
ready: function () {} });
2. 個別に初期化して、後で通知します。
$.ig.loader({
scriptPath: '../../../Source/ClientUI/js/',
cssPath: '../../../Source/ClientUI/css/',
resources: 'igGrid'});
$.ig.loader(function () {
// 1 組の igGrids を作成します
$("#grid1").igGrid({
virtualization: false,
autoGenerateColumns: true,
...
}
}
3. 個別の初期化によりオンデマンドでリソースを読み込みます。
$.ig.loader({
scriptPath: '../../../Source/ClientUI/js/',
cssPath: '../../../Source/ClientUI/css/'
});
$.ig.loader('igGrid', function () {
// 1 組の igGrids を作成します
$("#grid1").igGrid({
virtualization: false,
autoGenerateColumns: true,
...
}
}
4. チェーン化されたメソッドを使用します。
$.ig.loader().load('igGrid', function () {...}).load('igTree', function() {...});.- param1
- タイプ:object
- オプション
- param2
- タイプ:string
- オプション
- param3
- タイプ:function
- オプション
コード サンプル
$.ig.loader({ scriptPath: "js/", cssPath: "css/", resources: "igmList", ready: function () { onReady(); } });