AppML API


AppML API は、AppML のメソッドとプロパティを定義します。


メソッドとプロパティは何ができるの?

メソッドとプロパティで次のことができます:


new AppML() 新規 AppML オブジェクトの作成。
dataSource
AppML オブジェクトのデータソース設定。
getData()
データの取得。
data.records
データレコードの包含。

レコードをループし、HTML 要素のコンテンツを表示できます:

// Create an AppML object and fetch the data
myObj = new AppML();
myObj.dataSource = "http://www.w3schools.com/appml/customers.php";
myObj.getData();

// Locate the data records
myArr = myObj.data.records;
len = myArr.length;

// Display the records
for (i = 0; i < len; i++) {
    txt += myArr[i].CustomerName + "<br>";
}
document.getElementById("demo").innerHTML = txt;
Try It Yourself »

結果

Alfreds Futterkiste
Berglunds snabbköp
Centro comercial Moctezuma
Ernst Handel
FISSA Fabrica Inter. Salchichas S.A.
Galería del gastrónomo
Island Trading
Königlich Essen
Laughing Bacchus Wine Cellars
Magazzini Alimentari Riuniti
North/South
Paris spécialités
Rattlesnake Canyon Grocery
Simons bistro
Big Cheese
Vaffeljernet
Wolski Zajazd

いくつかの AppML メソッド

メソッド 説明
new AppML() 新規 AppML オブジェクトの作成
run() アプリケーション・オブジェクトの実行
appml("name") 指定した名前を持つ appml オブジェクトを返す
displayMessage(text) 指定したメッセージの表示
setError(no, description) 指定したエラーとエラー説明の設定

いくつかの AppML プロパティ

プロパティ 説明
appName アプリケーション名 (container id)
container アプリケーション・コンテナ要素
controller アプリケーション・コントローラ
data アプリケーション・データ・オブジェクト
dataSource アプリケーション・データ・ソース
message アプリケーション・メッセージ

いくつかの データ・オブジェクト・プロパティ

プロパティ 説明
data.model アプリケーション・データ・モデル
data.records アプリケーション・データ・レコード