ऐपएमएल ट्यूटोरियल

ऐपएमएल होम AppML कैसे करें ऐपएमएल डेटा ऐपएमएल में शामिल हैं ऐपएमएल नियंत्रक ऐपएमएल संदेश ऐपएमएल मॉडल ऐपएमएल एपीआई

ऐपएमएल मामले

केस परिचय केस टेक्स्ट फ़ाइल केस एक्सएमएल फाइल केस JSON फ़ाइल केस ग्राहक केस उत्पाद केस सप्लायर्स केस शिपर्स केस श्रेणियाँ केस कर्मचारी

ऐपएमएल क्लाइंट

ऐपएमएल क्लाइंट ऐपएमएल प्रोटोटाइप ऐपएमएल सूचियां ऐपएमएल फॉर्म ऐपएमएल वेबएसक्यूएल

ऐपएमएल सर्वर

ऐपएमएल पीएचपी एपीपीएमएल एएसपी

ऐपएमएल क्लाउड

गूगल क्लाउड एसक्यूएल अमेज़ॅन आरडीएस एसक्यूएल

ऐपएमएल संदर्भ

ऐपएमएल संदर्भ ऐपएमएल डेटाफाइल्स ऐपएमएल डेटाबेस ऐपएमएल एपीआई ऐपएमएल आर्किटेक्चर ऐपएमएल इतिहास

ऐप एमएल संदर्भ


AppML HTML विशेषताएँ

उदाहरण

<div appml-include-html="inc_header.htm"></div>

<h1>Customers</h1>
<table appml-data="customers.js" appml-controller="myController">
  <tr>
    <th>Customer</th>
    <th>City</th>
    <th>Country</th>
  </tr>
  <tr appml-repeat="records">
    <td>{{CustomerName}}</td>
    <td>{{City}}</td>
    <td>{{Country}}</td>
  </tr>
</table>

<div appml-include-html="inc_footer.htm"></div>
Attribute Description Explained
appml-controller Defines an AppML controller AppML Controllers
appml-data Defines the data source for an application AppML Data
appml-include-html Defines HTML to be included AppML Includes
appml-repeat Defines an HTML element to be repeated AppML Howto

ऐपएमएल संदेश

उदाहरण

function myController($appml) {
    if ($appml.message == "display") {
        if ($appml.display.name == "CustomerName") {
            $appml.display.value = $appml.display.value.toUpperCase();
        }
    }
}
Message Sent
ready After AppML is initiated, and ready to load data.
loaded After AppML is fully loaded, ready to display data.
display Before AppML displays a data item.
done After AppML is done (finished displaying).
submit Before AppML submits data.
error After AppML has encountered an error.

ऐपएमएल संदेशों के बारे में अध्याय में ऐपएमएल संदेशों की व्याख्या की गई है ।


ऐपएमएल मॉडल

उदाहरण

{
"security": "admin",
"rowsperpage" : 10,

"database": {
    "connection": "mysql",
    "sql"       : "SELECT * FROM Customers",
    "orderby"   : "CustomerName"}},

"filteritems" : [
    {"item" : "CustomerName", "label" : "Customer"},
    {"item" : "City"},
    {"item" : "Country"}],

"sortitems" : [
    {"item" : "CustomerName", "label" : "Customer"},
    {"item" : "City"},
    {"item" : "Country"}]
}

ऐपएमएल मॉडल गुण

Element Description
"data" Defines a flat file source for the model
"database" Defines a database source for the model
"filteritems" Defines filter restrictions
"rowsperpage" Defines number of rows to be fetched per page
"security" Defines the security for the model
"sortitems" Defines sorting restrictions

आवेदन सुरक्षा

इस एप्लिकेशन तक पहुंचने के लिए आपको "व्यवस्थापक" समूह के सदस्य के रूप में लॉग इन करना होगा:

उदाहरण

{
"security": "admin",
"database": {
    "connection": "mysql",
    "sql"       : "SELECT * FROM Customers",
    "orderby"   : "CustomerName"}
}

निजी मॉडल

आप मॉडल में अपना निजी डेटा जोड़ सकते हैं।

यह उदाहरण डेटा पर प्रतिबंध का सुझाव देता है:

उदाहरण

"restrictions" : {
    "fname" : {"maxlength": 40},
    "price" : {"max": 999,"min": 100}
    }

मॉडल डेटा का उपयोग सर्वर अनुप्रयोगों और आपके ऐपएमएल नियंत्रक द्वारा किया जा सकता है।

यह उदाहरण इनपुट को मान्य करने के लिए मॉडल डेटा का उपयोग करता है:

उदाहरण

function myController($appml) {
    if ($appml.message == "submit") {
        var price = document.getElementById("price").value;
        if (price < $appml.model.restrictions.price.min) {
            $appml.displayError(15, "Price too low!");
            return;
        }
}