PageRenderTime 484ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/plugins/datatables/extensions/Editor/examples/simple/simple.html

https://gitlab.com/victor.flores/prueba
HTML | 374 lines | 335 code | 39 blank | 0 comment | 0 complexity | e5b5e1f574572a6c74fc10ead1d4ad59 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
  6. <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
  7. <title>Editor example - Basic initialisation</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../media/css/jquery.dataTables.css">
  9. <link rel="stylesheet" type="text/css" href="../../../TableTools/css/dataTables.tableTools.css">
  10. <link rel="stylesheet" type="text/css" href="../../css/dataTables.editor.css">
  11. <link rel="stylesheet" type="text/css" href="../../../../examples/resources/syntax/shCore.css">
  12. <link rel="stylesheet" type="text/css" href="../../../../examples/resources/demo.css">
  13. <style type="text/css" class="init">
  14. </style>
  15. <script type="text/javascript" language="javascript" src="../../../../media/js/jquery.js"></script>
  16. <script type="text/javascript" language="javascript" src="../../../../media/js/jquery.dataTables.js"></script>
  17. <script type="text/javascript" language="javascript" src="../../../TableTools/js/dataTables.tableTools.js"></script>
  18. <script type="text/javascript" language="javascript" src="../../js/dataTables.editor.js"></script>
  19. <script type="text/javascript" language="javascript" src="../../../../examples/resources/syntax/shCore.js"></script>
  20. <script type="text/javascript" language="javascript" src="../../../../examples/resources/demo.js"></script>
  21. <script type="text/javascript" language="javascript" src="../resources/editor-demo.js"></script>
  22. <script type="text/javascript" language="javascript" class="init">
  23. var editor; // use a global for the submit and return data rendering in the examples
  24. $(document).ready(function() {
  25. editor = new $.fn.dataTable.Editor( {
  26. ajax: "../php/staff.php",
  27. table: "#example",
  28. fields: [ {
  29. label: "First name:",
  30. name: "first_name"
  31. }, {
  32. label: "Last name:",
  33. name: "last_name"
  34. }, {
  35. label: "Position:",
  36. name: "position"
  37. }, {
  38. label: "Office:",
  39. name: "office"
  40. }, {
  41. label: "Extension:",
  42. name: "extn"
  43. }, {
  44. label: "Start date:",
  45. name: "start_date",
  46. type: "date"
  47. }, {
  48. label: "Salary:",
  49. name: "salary"
  50. }
  51. ]
  52. } );
  53. $('#example').DataTable( {
  54. dom: "Tfrtip",
  55. ajax: "../php/staff.php",
  56. columns: [
  57. { data: null, render: function ( data, type, row ) {
  58. // Combine the first and last names into a single table field
  59. return data.first_name+' '+data.last_name;
  60. } },
  61. { data: "position" },
  62. { data: "office" },
  63. { data: "extn" },
  64. { data: "start_date" },
  65. { data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
  66. ],
  67. tableTools: {
  68. sRowSelect: "os",
  69. aButtons: [
  70. { sExtends: "editor_create", editor: editor },
  71. { sExtends: "editor_edit", editor: editor },
  72. { sExtends: "editor_remove", editor: editor }
  73. ]
  74. }
  75. } );
  76. } );
  77. </script>
  78. </head>
  79. <body class="dt-example">
  80. <div class="container">
  81. <section>
  82. <h1>Editor example <span>Basic initialisation</span></h1>
  83. <div class="info">
  84. <p><a href="//editor.datatables.net">Editor</a> is a Create, Read, Update and Delete (CRUD) extension
  85. for <a href="//datatables.net">DataTables</a> that provides the ability to easily add, edit and delete
  86. rows on a database that is displayed by a DataTable. Editor provides a clean and responsive interface
  87. for end user manipulation of data, an expressive API for complete control and a well defined server
  88. communications protocol for data submission.</p>
  89. <p>This simple example shows a table with seven fields, each of which can be edited as plain text. In
  90. other examples we will explore how to add date pickers, <code class="tag" title=
  91. "HTML tag">select</code> elements and other controls to make form input intuitive for the system user,
  92. among many other aspects of the Editor API.</p>
  93. </div>
  94. <table id="example" class="display" cellspacing="0" width="100%">
  95. <thead>
  96. <tr>
  97. <th>Name</th>
  98. <th>Position</th>
  99. <th>Office</th>
  100. <th>Extn.</th>
  101. <th>Start date</th>
  102. <th>Salary</th>
  103. </tr>
  104. </thead>
  105. <tfoot>
  106. <tr>
  107. <th>Name</th>
  108. <th>Position</th>
  109. <th>Office</th>
  110. <th>Extn.</th>
  111. <th>Start date</th>
  112. <th>Salary</th>
  113. </tr>
  114. </tfoot>
  115. </table>
  116. <ul class="tabs">
  117. <li class="active">Javascript</li>
  118. <li>HTML</li>
  119. <li>CSS</li>
  120. <li>Ajax</li>
  121. <li>Server-side script</li>
  122. </ul>
  123. <div class="tabs">
  124. <div class="js">
  125. <p>The Javascript shown below is used to initialise the table shown in this
  126. example:</p><code class="multiline brush: js;">var editor; // use a global for the submit and return data rendering in the examples
  127. $(document).ready(function() {
  128. editor = new $.fn.dataTable.Editor( {
  129. ajax: &quot;../php/staff.php&quot;,
  130. table: &quot;#example&quot;,
  131. fields: [ {
  132. label: &quot;First name:&quot;,
  133. name: &quot;first_name&quot;
  134. }, {
  135. label: &quot;Last name:&quot;,
  136. name: &quot;last_name&quot;
  137. }, {
  138. label: &quot;Position:&quot;,
  139. name: &quot;position&quot;
  140. }, {
  141. label: &quot;Office:&quot;,
  142. name: &quot;office&quot;
  143. }, {
  144. label: &quot;Extension:&quot;,
  145. name: &quot;extn&quot;
  146. }, {
  147. label: &quot;Start date:&quot;,
  148. name: &quot;start_date&quot;,
  149. type: &quot;date&quot;
  150. }, {
  151. label: &quot;Salary:&quot;,
  152. name: &quot;salary&quot;
  153. }
  154. ]
  155. } );
  156. $('#example').DataTable( {
  157. dom: &quot;Tfrtip&quot;,
  158. ajax: &quot;../php/staff.php&quot;,
  159. columns: [
  160. { data: null, render: function ( data, type, row ) {
  161. // Combine the first and last names into a single table field
  162. return data.first_name+' '+data.last_name;
  163. } },
  164. { data: &quot;position&quot; },
  165. { data: &quot;office&quot; },
  166. { data: &quot;extn&quot; },
  167. { data: &quot;start_date&quot; },
  168. { data: &quot;salary&quot;, render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
  169. ],
  170. tableTools: {
  171. sRowSelect: &quot;os&quot;,
  172. aButtons: [
  173. { sExtends: &quot;editor_create&quot;, editor: editor },
  174. { sExtends: &quot;editor_edit&quot;, editor: editor },
  175. { sExtends: &quot;editor_remove&quot;, editor: editor }
  176. ]
  177. }
  178. } );
  179. } );</code>
  180. <p>In addition to the above code, the following Javascript library files are loaded for use in this
  181. example:</p>
  182. <ul>
  183. <li><a href="../../../../media/js/jquery.js">../../../../media/js/jquery.js</a></li>
  184. <li><a href=
  185. "../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a></li>
  186. <li><a href=
  187. "../../../TableTools/js/dataTables.tableTools.js">../../../TableTools/js/dataTables.tableTools.js</a></li>
  188. <li><a href="../../js/dataTables.editor.js">../../js/dataTables.editor.js</a></li>
  189. </ul>
  190. </div>
  191. <div class="table">
  192. <p>The HTML shown below is the raw HTML table element, before it has been enhanced by
  193. DataTables:</p>
  194. </div>
  195. <div class="css">
  196. <div>
  197. <p>This example uses a little bit of additional CSS beyond what is loaded from the library
  198. files (below), in order to correctly display the table. The additional CSS used is shown
  199. below:</p><code class="multiline brush: js;"></code>
  200. </div>
  201. <p>The following CSS library files are loaded for use in this example to provide the styling of the
  202. table:</p>
  203. <ul>
  204. <li><a href=
  205. "../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a></li>
  206. <li><a href=
  207. "../../../TableTools/css/dataTables.tableTools.css">../../../TableTools/css/dataTables.tableTools.css</a></li>
  208. <li><a href="../../css/dataTables.editor.css">../../css/dataTables.editor.css</a></li>
  209. </ul>
  210. </div>
  211. <div class="ajax">
  212. <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
  213. will update automatically as any additional data is loaded.</p>
  214. </div>
  215. <div class="php">
  216. <p>The script used to perform the server-side processing for this table is shown below. Please note
  217. that this is just an example script using PHP. Server-side processing scripts can be written in any
  218. language, using <a href="//datatables.net/manual/server-side">the protocol described in the
  219. DataTables documentation</a>.</p>
  220. </div>
  221. </div>
  222. </section>
  223. </div>
  224. <section>
  225. <div class="footer">
  226. <div class="gradient"></div>
  227. <div class="liner">
  228. <h2>Other examples</h2>
  229. <div class="toc">
  230. <div class="toc-group">
  231. <h3><a href="./index.html">Simple initialisation</a></h3>
  232. <ul class="toc active">
  233. <li class="active"><a href="./simple.html">Basic initialisation</a></li>
  234. <li><a href="./fieldDefaults.html">Setting defaults</a></li>
  235. <li><a href="./fieldTypes.html">Field types</a></li>
  236. <li><a href="./dates.html">Dates (with jQuery UI datepicker)</a></li>
  237. <li><a href="./i18n.html">Internationalisation</a></li>
  238. <li><a href="./inTableControls.html">In table form controls</a></li>
  239. <li><a href="./responsive.html">Responsive table extension</a></li>
  240. <li><a href="./server-side-processing.html">Server-side processing</a></li>
  241. <li><a href="./join.html">Join tables - working with multiple SQL tables</a></li>
  242. </ul>
  243. </div>
  244. <div class="toc-group">
  245. <h3><a href="../advanced/index.html">Advanced initialisation</a></h3>
  246. <ul class="toc">
  247. <li><a href="../advanced/formOnlyData.html">Data shown only in the form</a></li>
  248. <li><a href="../advanced/tableOnlyData.html">Data shown in table only</a></li>
  249. <li><a href="../advanced/deepObjects.html">Complex (nested) JSON data source</a></li>
  250. <li><a href="../advanced/REST.html">REST interface</a></li>
  251. <li><a href="../advanced/localstorage.html">Ajax override - using localStorage for the data
  252. source</a></li>
  253. <li><a href="../advanced/jsonId.html">Row ID source specification</a></li>
  254. <li><a href="../advanced/htmlTable.html">DOM sourced table</a></li>
  255. <li><a href="../advanced/exportButtons.html">Export buttons</a></li>
  256. <li><a href="../advanced/joinSelf.html">Join tables - self referencing join</a></li>
  257. <li><a href="../advanced/joinLinkTable.html">Join tables - link table</a></li>
  258. <li><a href="../advanced/joinArray.html">Join tables - one-to-many join</a></li>
  259. </ul>
  260. </div>
  261. <div class="toc-group">
  262. <h3><a href="../bubble-editing/index.html">Bubble editing</a></h3>
  263. <ul class="toc">
  264. <li><a href="../bubble-editing/simple.html">Simple bubble editing</a></li>
  265. <li><a href="../bubble-editing/grouped.html">Multiple fields in a bubble</a></li>
  266. <li><a href="../bubble-editing/options.html">Form control and display options</a></li>
  267. <li><a href="../bubble-editing/defaultOptions.html">Default control and display
  268. options</a></li>
  269. <li><a href="../bubble-editing/inTableControls.html">Bubble editing with in table row
  270. controls</a></li>
  271. </ul>
  272. </div>
  273. <div class="toc-group">
  274. <h3><a href="../inline-editing/index.html">Inline editing</a></h3>
  275. <ul class="toc">
  276. <li><a href="../inline-editing/simple.html">Simple inline editing</a></li>
  277. <li><a href="../inline-editing/tabControl.html">Tab between columns</a></li>
  278. <li><a href="../inline-editing/options.html">Editing options - submit on blur</a></li>
  279. <li><a href="../inline-editing/submitButton.html">Inline editing with a submit
  280. button</a></li>
  281. <li><a href="../inline-editing/editIcon.html">Edit icon</a></li>
  282. </ul>
  283. </div>
  284. <div class="toc-group">
  285. <h3><a href="../api/index.html">API</a></h3>
  286. <ul class="toc">
  287. <li><a href="../api/confirmClose.html">Events - unsaved changes close confirmation</a></li>
  288. <li><a href="../api/clientValidation.html">Client-side validation</a></li>
  289. <li><a href="../api/triggerButton.html">Customised control buttons</a></li>
  290. <li><a href="../api/backNext.html">Previous / next editing buttons</a></li>
  291. <li><a href="../api/duplicateButton.html">Duplicate button</a></li>
  292. </ul>
  293. </div>
  294. <div class="toc-group">
  295. <h3><a href="../standalone/index.html">Standalone</a></h3>
  296. <ul class="toc">
  297. <li><a href="../standalone/simple.html">Simple standalone editing</a></li>
  298. <li><a href="../standalone/bubble.html">Bubble editing</a></li>
  299. <li><a href="../standalone/inline.html">Inline editing</a></li>
  300. </ul>
  301. </div>
  302. <div class="toc-group">
  303. <h3><a href="../styling/index.html">Styling</a></h3>
  304. <ul class="toc">
  305. <li><a href="../styling/envelope.html">Envelope display controller</a></li>
  306. <li><a href="../styling/envelopeInTable.html">Envelope display with in table
  307. controls</a></li>
  308. <li><a href="../styling/stackedInputs.html">Styled for stacked inputs</a></li>
  309. <li><a href="../styling/bootstrap.html">Bootstrap</a></li>
  310. <li><a href="../styling/jqueryui.html">jQuery UI</a></li>
  311. </ul>
  312. </div>
  313. <div class="toc-group">
  314. <h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
  315. <ul class="toc">
  316. <li><a href="../plug-ins/fieldPlugin.html">Custom field type plug-ins</a></li>
  317. <li><a href="../plug-ins/displayController.html">Custom display controller</a></li>
  318. </ul>
  319. </div>
  320. </div>
  321. <div class="epilogue">
  322. <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
  323. information about its API properties and methods.<br>
  324. Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
  325. <a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
  326. DataTables.</p>
  327. <p class="copyright">DataTables designed and created by <a href=
  328. "http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2014<br>
  329. DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
  330. </div>
  331. </div>
  332. </div>
  333. </section>
  334. </body>
  335. </html>