AppML কেস স্টাডি – শ্রেণীবিভাগ সমূহ (AppML Case Study – Categories)

এইচটিএমএল

এইচটিএমএল সোর্স:


<!DOCTYPE html>
 <html lang="en-US">
 <title>Categories</title>
 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
 <script src="http://www.w3schools.com/appml/2.0.3/appml.js"></script>
 <body>
 
 <div class="container">
 <h1>Categories</h1>
 
 <div id="Form01" class="jumbotron" style="display:none" appml-data="local?model=model_categoriesform" 
                                                                 appml-controller="myFormController">
   <div appml-include-html="inc_formcommands.htm"></div>
   <div class="form-group">
     <label>CategoryName:</label>
     <input id="CategoryName" class="form-control">
   </div>
   <div class="form-group">
     <label>Description:</label>
     <input id="Description" class="form-control">
   </div>
 </div>
 
 <div appml-data="local?model=model_categorieslist">
   <div appml-include-html="inc_listcommands_nofilter.htm"></div>
   <table class="table table-striped table-bordered">
   <tr>
     <th></th>
     <th>Category</th>
     <th>Description</th>
   </tr>
   <tr appml-repeat="records">
     <td style="cursor:pointer"
     onclick="appml('Form01').run({{CategoryID}})">
     <span class="glyphicon glyphicon-edit"></span>
     </td>
     <td>{{CategoryName}}</td>
     <td>{{Description}}</td>
     </tr>
   </table>
 </div>
 
 </div>
 
 <script>
 function myFormController($appml) {
     if ($appml.message == "ready") {return -1;}
     if ($appml.message == "loaded") {
         document.getElementById("Form01").style.display = "";
     }
 }
 </script>
 
 </body>
 </html>

 

 

মডেল

এই অ্যাপ্লিকেশনের মধ্যে ব্যবহৃত মডেল

লিস্ট মডেল


 {
 "database" : {
 "connection" : "localmysql",
 "sql" : "SELECT * FROM Categories"
 }
 }

 

 

ফরম মডেল


 {
 "database" : {
 "connection" : "localmysql",
 "sql" : "SELECT * FROM Categories",
 "maintable" : "Categories",
 "keyfield" : "CategoryID"
 },
 "updateItems" : [
 {"item" : "CategoryName"},
 {"item" : "Description"}
 ]
 }

 

Permanent link to this article: http://bangla.sitestree.com/appml-%e0%a6%95%e0%a7%87%e0%a6%b8-%e0%a6%b8%e0%a7%8d%e0%a6%9f%e0%a6%be%e0%a6%a1%e0%a6%bf-%e0%a6%b6%e0%a7%8d%e0%a6%b0%e0%a7%87%e0%a6%a3%e0%a7%80%e0%a6%ac%e0%a6%bf%e0%a6%ad%e0%a6%be%e0%a6%97-%e0%a6%b8/

Leave a Reply