writer.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>Writer Example</title>
  6. <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
  7. <link rel="stylesheet" type="text/css" href="../shared/example.css" />
  8. <link rel="stylesheet" type="text/css" href="writer.css" />
  9. <!-- GC -->
  10. <script type="text/javascript" src="../../ext-all.js"></script>
  11. <script type="text/javascript" src="../shared/examples.js"></script>
  12. <script type="text/javascript" src="writer.js"></script>
  13. </head>
  14. <body>
  15. <h1>Ext.data.writer.Writer Example</h1>
  16. <p>This example shows how to implement a Writer for your Store. A Writer-enabled Store frees you from having to manually compose Ajax requests
  17. to perform CRUD actions on a Store.</p>
  18. <p>Note that the js is not minified so it is readable. See <a href="writer.js">writer.js</a>.
  19. <p>The AjaxProxy plugged into the store in this example uses the <em>api</em> configuration instead of an <em>url</em>.
  20. A simple MVC-like php backend has been created for this example which simulates a database by storing records in $_SESSION. See the file /remote/app/controllers/users.php. You may have to configure
  21. your web-server to allow scripts to be executed in the /examples directory.</p>
  22. <p>Take note of the requests being generated in Firebug as you interact with the Grid and Form.</p>
  23. <p>An <b>Error has been simulated</b> on the server-side: Attempting to update a record having <b>ODD</b>-numbered id will generate this errror.
  24. Responses from the update action will have successProperty === false along with a message. This error can be handled by
  25. listening to the <b>"exception"</b> event upon your proxy.</p>
  26. </body>
  27. </html>