codecamp

AppML 案例 Products

<AppML> Products - 完整的应用程序



源代码

HTML 源代码

<html>
<body>

<h1>Products</h1>

<div id="Form01"></div>
<div id="List01"></div><br>

<table id="Template01" class="appmltable" style="width:100%;display:none">
<tr>
<th></th>
<th>Product Name</th>
<th>Category</th>
<th>Supplier</th>
</tr>
<tr id="appml_row">
<td style="cursor:pointer" onclick="productForm.run('Form01','Template02','#ProductID#')">
<img src="Images/appmlPlus.png"></td>
<td>#ProductName#</td>
<td>#CategoryName#</td>
<td>#SupplierName#</td>
</tr>
</table>

<div id="Template02" class="appmlform" style="width:100%;display:none">
<label>ProductName:</label><input id="ProductName">
<label>Supplier:</label>
<select id="SupplierID" data-appmlapplication="Models/Dropdown_Suppliers">
</select>
<label>Category:</label>
<select id="CategoryID" data-appmlapplication="Models/Dropdown_Categories">
</select>
<label>Unit:</label><input id="Unit">
<label>Price:</label><input id="Price">
</div>

<script src="appml.js"></script>
<script>
var products,productForm
products=new AppML("appml.php","Models/Products");
products.run("List01","Template01");
productForm=new AppML("appml.php","Models/Products");
productForm.displayType="form";
</script>

</body>
</html>
AppML 案例 Customers
AppML 未来的应用程序
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }