최고의 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>
»시도 다음 섹션에서는 전체 소스 코드와 더 많은 응용 프로그램을 볼 수 있습니다.