File: restful.html

package info (click to toggle)
libjs-extjs 3.0.3%2Bdfsg0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 48,024 kB
  • ctags: 4,182
  • sloc: php: 819; xml: 537; sql: 44; makefile: 33
file content (48 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>RESTful Store Example</title>

<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />

    <!-- GC -->
     <!-- LIBS -->
     <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
     <!-- ENDLIBS -->

    <script type="text/javascript" src="../../ext-all.js"></script>
    <script type="text/javascript" src="../shared/extjs/App.js"></script>
    <script type="text/javascript" src="restful.js"></script>
    <script type="text/javascript" src="../ux/RowEditor.js"></script>

    <link rel="stylesheet" type="text/css" href="restful.css" />
    <link rel="stylesheet" href="../ux/css/RowEditor.css" />

    <!-- Common Styles for the examples -->
    <link rel="stylesheet" type="text/css" href="../shared/examples.css" />
    <link rel="stylesheet" type="text/css" href="../shared/icons/silk.css" />
</head>
<body>
<script type="text/javascript" src="../shared/examples.js"></script><!-- EXAMPLES -->
<h1>RESTful Store Example</h1>
<p>This example shows how to implement a RESTful Store.  A Store is made RESTful by simply setting the new configuration-property <strong><i>restful: true</i></strong>
and plugging a suitable <strong>Ext.data.DataWriter</strong> into your Store.  This example uses <strong>Ext.data.JsonWriter</strong>.</p>

<p>Note that the js is not minified so it is readable. See <a href="restful.js">restful.js</a></p>

<p>Take note of the requests being generated in Firebug as you interact with the Grid.</p>

<p>The HttpProxy in this example points to a single url <strong>app.php/users</strong>.  You may have to edit your web-server's configuration to allow the
php back-end to be executable.  app.php implements a simple RESTful backend controller and simulates a database by storing records in the $_SESSION.</p>
<code><pre>
var proxy = new Ext.data.HttpProxy({
    url: 'app.php/users'
});

</pre></code>
<div class="container" style="width:500px">
    <div id="user-grid"></div>
</div>

</body>
</html>