AppMLケーステンプレート2024 年の最新の入門チュートリアル。このコースでは HTMLテンプレートの追加,顧客リスト,HTML - ビュー,顧客やクライアントのフォームを一覧表示します,HTML - ビュー,顧客リストおよび顧客の注文,HTML - ビュー,これで、すべてのマージ,顧客リストと注文フォーム, について学習できます。
AppMLケーステンプレート
このケーススタディでは、データベース、編集、検索機能内のテーブルの数のために記載されている情報で、完全な<AppML>インターネットアプリケーションを構築する方法を示します。
HTMLテンプレートの追加
この章では、HTMLページにHTMLテンプレートを追加する方法を紹介します。
顧客リスト
HTML - ビュー
<h1>Customers</h1>
<div id="List01"></div><br>
<table
id="Template01" class="appmltable" style="display:none">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr id="appml_row">
<td>#CustomerName#</td>
<td>#City#</td>
<td>#Country#</td>
</tr>
</table>
<script src="appml.js"></script>
<script>
var customers
customers=new AppML("appml.php","Models/Customers");
customers.run("List01","Template01");
</script>
»をお試しください
顧客やクライアントのフォームを一覧表示します
テンプレートの賢い利用することで、簡単にオブジェクトのリンク<AppML>リストとの間で、<AppML>フォームを追加することができます。
HTML - ビュー
<h1>Customers</h1>
<div id="Form01"></div><br>
<div
id="List01"></div><br>
<table id="Template01" class="appmltable"
style="width:100%;display:none">
<tr>
<th></th>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr id="appml_row">
<td
style="cursor:pointer" onclick="openForm('#CustomerID#')">
<img
src="images/appmlFolder.png"></td>
<td>#CustomerName#</td>
<td>#City#</td>
<td>#Country#</td>
</tr>
</table>
<script
src="appml.js"></script>
<script>
var customers,customerForm;
customers=new AppML("appml.php","Models/Customers");
customers.run("List01","Template01");
function openForm(id)
{
customerForm=new AppML("appml.php","Models/Customers");
customerForm.displayType="form";
customerForm.run("Form01","",id);
}
</script>
»をお試しください
顧客リストおよび顧客の注文
テンプレートの賢い利用することで、簡単にリンクを<AppML>オブジェクトのリストとの間のリンクのリストを追加することができます。
HTML - ビュー
<h1>Customers</h1>
<div id="List01"></div><br>
<div
id="Orders01"></div><br>
<table id="Template01" class="appmltable"
style="width:100%;display:none">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
<th></th>
</tr>
<tr
id="appml_row">
<td>#CustomerName#</td>
<td>#City#</td>
<td>#Country#</td>
<td><a href=''
onclick='openOrders("#CustomerID#");return false;'>Orders</a></td>
</tr>
</table>
<table id="Template02" class="appmltable"
style="width:100%;display:none">
<tr>
<th>Customer</th>
<th>Date</th>
<th>Salesperson</th>
<th>Shipper</th>
</tr>
<tr
id="appml_row">
<td>#CustomerName#</td>
<td>#OrderDate#</td>
<td>#Salesperson#</td>
<td>#ShipperName#</td>
</tr>
</table>
<script src="appml.js"></script>
<script>
var customers,orders;
customers=new AppML("appml.php","Models/Customers");
customers.run("List01","Template01");
function openOrders(id)
{
orders=new AppML("appml.php","Models/Orders");
orders.setQuery("orders.customerid",id);
orders.commands=false;
orders.run("Orders01","Template02");
}
</script>
»をお試しください
これで、すべてのマージ
最後に、コードの重複を少量、我々はプロジェクトを完了することができます。
顧客リストと注文フォーム
<h1>Customers</h1>
<div id="List01">
<table id="appml_list"
class="appmllist">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
<th></th>
</tr>
<tr id="appml_row">
<td>#CustomerName#</td>
<td>#City#</td>
<td>#Country#</td>
<td><a
href='' onclick='openOrders("#CustomerID#");return false;'>Orders</a></td>
</tr>
</table>
</div>
<div
id="List02"></div>
<script src="appml.js"></script>
<script>
var Customers,Orders
Customers=new AppML("appml.php","Models/Customers");
Customers.run("List01");
function openOrders(id)
{
var Orders=new
AppML("appml.php","Models/Orders");
Orders.setQuery("orders.customerid",id);
Orders.commands=false;
Orders.run("List02");
}
</script>
»をお試しください 次のセクションでは、完全なソースコードとのより多くのアプリケーションを見ることができます。