You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

459 regels
23 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Form Widget API &mdash; Documentation</title>
  7. <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '',
  13. COLLAPSE_MODINDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/doctools.js"></script>
  20. <link rel="top" title="Documentation" href="index.html" />
  21. <link rel="up" title="4. Client Side API" href="client_side_widgets.html" />
  22. <link rel="next" title="Report Builder" href="report_builder.html" />
  23. <link rel="prev" title="Accessing Local Data" href="local_data.html" />
  24. </head>
  25. <body>
  26. <div style="background-color: #FFF; text-align: left; padding: 8px 0px"><img src="_static/banner300910.gif"></div>
  27. <div class="related">
  28. <h3>Navigation</h3>
  29. <ul>
  30. <li class="right" style="margin-right: 10px">
  31. <a href="genindex.html" title="General Index"
  32. accesskey="I">index</a></li>
  33. <li class="right" >
  34. <a href="modindex.html" title="Global Module Index"
  35. accesskey="M">modules</a> |</li>
  36. <li class="right" >
  37. <a href="report_builder.html" title="Report Builder"
  38. accesskey="N">next</a> |</li>
  39. <li class="right" >
  40. <a href="local_data.html" title="Accessing Local Data"
  41. accesskey="P">previous</a> |</li>
  42. <li><a href="index.html">Documentation</a> &raquo;</li>
  43. <li><a href="client_side_widgets.html" accesskey="U">4. Client Side API</a> &raquo;</li>
  44. </ul>
  45. </div>
  46. <div class="sphinxsidebar">
  47. <div class="sphinxsidebarwrapper">
  48. <h3><a href="index.html">Table Of Contents</a></h3>
  49. <ul>
  50. <li><a class="reference external" href="">Form Widget API</a><ul>
  51. <li><a class="reference external" href="#scripting-forms">Scripting Forms</a></li>
  52. <li><a class="reference external" href="#form-container-class">Form Container Class</a></li>
  53. <li><a class="reference external" href="#form-class">Form Class</a></li>
  54. <li><a class="reference external" href="#field-class">Field Class</a></li>
  55. <li><a class="reference external" href="#grid-class">Grid Class</a></li>
  56. <li><a class="reference external" href="#examples">Examples</a></li>
  57. </ul>
  58. </li>
  59. </ul>
  60. <h4>Previous topic</h4>
  61. <p class="topless"><a href="local_data.html"
  62. title="previous chapter">Accessing Local Data</a></p>
  63. <h4>Next topic</h4>
  64. <p class="topless"><a href="report_builder.html"
  65. title="next chapter">Report Builder</a></p>
  66. <h3>This Page</h3>
  67. <ul class="this-page-menu">
  68. <li><a href="_sources/form_widget.txt"
  69. rel="nofollow">Show Source</a></li>
  70. </ul>
  71. <div id="searchbox" style="display: none">
  72. <h3>Quick search</h3>
  73. <form class="search" action="search.html" method="get">
  74. <input type="text" name="q" size="18" />
  75. <input type="submit" value="Go" />
  76. <input type="hidden" name="check_keywords" value="yes" />
  77. <input type="hidden" name="area" value="default" />
  78. </form>
  79. <p class="searchtip" style="font-size: 90%">
  80. Enter search terms or a module, class or function name.
  81. </p>
  82. </div>
  83. <script type="text/javascript">$('#searchbox').show(0);</script>
  84. </div>
  85. </div>
  86. <div class="document">
  87. <div class="documentwrapper">
  88. <div class="bodywrapper">
  89. <div class="body">
  90. <div class="section" id="form-widget-api">
  91. <h1>Form Widget API<a class="headerlink" href="#form-widget-api" title="Permalink to this headline">¶</a></h1>
  92. <div class="section" id="scripting-forms">
  93. <h2>Scripting Forms<a class="headerlink" href="#scripting-forms" title="Permalink to this headline">¶</a></h2>
  94. <p>Custom scripts can be written in forms by writing events in &#8220;Client Script&#8221; / &#8220;Client Script Core&#8221; in the
  95. DocType. Some conventions for writing client scripts</p>
  96. <ul class="simple">
  97. <li>All functions should be written in the namespace <cite>cur_frm.cscript</cite>. This namespace is set aside
  98. for customized client scripts</li>
  99. <li><cite>cur_frm</cite> is the global variable that represents the Current Form that is open.</li>
  100. </ul>
  101. <p>See Examples</p>
  102. </div>
  103. <div class="section" id="form-container-class">
  104. <h2>Form Container Class<a class="headerlink" href="#form-container-class" title="Permalink to this headline">¶</a></h2>
  105. <dl class="data">
  106. <dt id="_f">
  107. <tt class="descname">_f</tt><a class="headerlink" href="#_f" title="Permalink to this definition">¶</a></dt>
  108. <dd>Namespace for the Form Widget</dd></dl>
  109. <dl class="data">
  110. <dt id="_f.frm_con">
  111. <tt class="descclassname">_f.</tt><tt class="descname">frm_con</tt><a class="headerlink" href="#_f.frm_con" title="Permalink to this definition">¶</a></dt>
  112. <dd>Global FrmContainer. There is only one instance of the Form Container</dd></dl>
  113. <dl class="function">
  114. <dt id="_f.get_value">
  115. <tt class="descclassname">_f.</tt><tt class="descname">get_value</tt><big>(</big><em>dt</em>, <em>dn</em>, <em>fn</em><big>)</big><a class="headerlink" href="#_f.get_value" title="Permalink to this definition">¶</a></dt>
  116. <dd>Returns the value of the field <cite>fn</cite> from DocType <cite>dt</cite> and name <cite>dn</cite></dd></dl>
  117. <dl class="function">
  118. <dt>
  119. <tt class="descclassname">_f.</tt><tt class="descname">get_value</tt><big>(</big><em>dt</em>, <em>dn</em>, <em>fn</em>, <em>v</em><big>)</big></dt>
  120. <dd><p>Sets value <cite>v</cite> in the field <cite>fn</cite> of the give <cite>dt</cite> and <cite>dn</cite></p>
  121. <ul class="simple">
  122. <li>Will also set the record as __unsaved = 1</li>
  123. <li>Will refresh the display so that the record is set as &#8220;Changes are not saved&#8221;</li>
  124. </ul>
  125. </dd></dl>
  126. <dl class="class">
  127. <dt id="_f.FrmContainer">
  128. <em class="property">class </em><tt class="descclassname">_f.</tt><tt class="descname">FrmContainer</tt><a class="headerlink" href="#_f.FrmContainer" title="Permalink to this definition">¶</a></dt>
  129. <dd><p>This is the object that contains all Forms. The Form Container contains the page header and Form toolbar
  130. that is refreshed whenever a new record is shown.</p>
  131. <dl class="attribute">
  132. <dt id="_f.FrmContainer.head">
  133. <tt class="descname">head</tt><a class="headerlink" href="#_f.FrmContainer.head" title="Permalink to this definition">¶</a></dt>
  134. <dd>Element representing the header of the form.</dd></dl>
  135. <dl class="attribute">
  136. <dt id="_f.FrmContainer.body">
  137. <tt class="descname">body</tt><a class="headerlink" href="#_f.FrmContainer.body" title="Permalink to this definition">¶</a></dt>
  138. <dd>Element represnting the page body</dd></dl>
  139. <dl class="method">
  140. <dt id="_f.FrmContainer.show_head">
  141. <tt class="descname">show_head</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.FrmContainer.show_head" title="Permalink to this definition">¶</a></dt>
  142. <dd>Show the head element</dd></dl>
  143. <dl class="method">
  144. <dt id="_f.FrmContainer.hide_head">
  145. <tt class="descname">hide_head</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.FrmContainer.hide_head" title="Permalink to this definition">¶</a></dt>
  146. <dd>Show the head element</dd></dl>
  147. <dl class="method">
  148. <dt id="_f.FrmContainer.add_frm">
  149. <tt class="descname">add_frm</tt><big>(</big><em>doctype</em>, <em>onload</em>, <em>opt_name</em><big>)</big><a class="headerlink" href="#_f.FrmContainer.add_frm" title="Permalink to this definition">¶</a></dt>
  150. <dd>Called internally by <a title="loaddoc" class="reference external" href="navigation.html#loaddoc"><tt class="xref docutils literal"><span class="pre">loaddoc()</span></tt></a>. Adds a new Form of type <cite>doctype</cite> in the FrmContainer.</dd></dl>
  151. </dd></dl>
  152. </div>
  153. <div class="section" id="form-class">
  154. <h2>Form Class<a class="headerlink" href="#form-class" title="Permalink to this headline">¶</a></h2>
  155. <dl class="class">
  156. <dt id="_f.Frm">
  157. <em class="property">class </em><tt class="descclassname">_f.</tt><tt class="descname">Frm</tt><a class="headerlink" href="#_f.Frm" title="Permalink to this definition">¶</a></dt>
  158. <dd><p>Each doctype has a Frm object. When records are loaded on the Frm object, fields inside the form are
  159. refreshed</p>
  160. <dl class="attribute">
  161. <dt id="_f.Frm.doctype">
  162. <tt class="descname">doctype</tt><a class="headerlink" href="#_f.Frm.doctype" title="Permalink to this definition">¶</a></dt>
  163. <dd><cite>doctype</cite> of the current form</dd></dl>
  164. <dl class="attribute">
  165. <dt id="_f.Frm.docname">
  166. <tt class="descname">docname</tt><a class="headerlink" href="#_f.Frm.docname" title="Permalink to this definition">¶</a></dt>
  167. <dd><cite>name</cite> of the current record</dd></dl>
  168. <dl class="attribute">
  169. <dt id="_f.Frm.fields">
  170. <tt class="descname">fields</tt><a class="headerlink" href="#_f.Frm.fields" title="Permalink to this definition">¶</a></dt>
  171. <dd>List of all <cite>Field</cite> objects in the form</dd></dl>
  172. <dl class="attribute">
  173. <dt id="_f.Frm.fields_dict">
  174. <tt class="descname">fields_dict</tt><a class="headerlink" href="#_f.Frm.fields_dict" title="Permalink to this definition">¶</a></dt>
  175. <dd>Dictionary of all <cite>Field</cite> objects in the form, identified by the <cite>fieldname</cite> or <cite>label</cite> (if no fieldname)
  176. exists</dd></dl>
  177. <dl class="attribute">
  178. <dt id="_f.Frm.sections">
  179. <tt class="descname">sections</tt><a class="headerlink" href="#_f.Frm.sections" title="Permalink to this definition">¶</a></dt>
  180. <dd>List of all sections known by section id (<cite>sec_id</cite>). (Id because Sections may not have headings / labels)</dd></dl>
  181. <dl class="attribute">
  182. <dt id="_f.Frm.sections_by_label">
  183. <tt class="descname">sections_by_label</tt><a class="headerlink" href="#_f.Frm.sections_by_label" title="Permalink to this definition">¶</a></dt>
  184. <dd><p>Dictionary of all sections by label. This can be used to switch to a particular section. Example:</p>
  185. <div class="highlight-python"><div class="highlight"><pre><span class="n">cur_frm</span><span class="o">.</span><span class="n">set_section</span><span class="p">(</span><span class="n">cur_frm</span><span class="o">.</span><span class="n">sections_by_label</span><span class="p">[</span><span class="s">&#39;More Details&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">sec_id</span><span class="p">);</span>
  186. </pre></div>
  187. </div>
  188. </dd></dl>
  189. <dl class="method">
  190. <dt id="_f.Frm.show">
  191. <tt class="descname">show</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.show" title="Permalink to this definition">¶</a></dt>
  192. <dd>Show the form</dd></dl>
  193. <dl class="method">
  194. <dt id="_f.Frm.hide">
  195. <tt class="descname">hide</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.hide" title="Permalink to this definition">¶</a></dt>
  196. <dd>Hide the form</dd></dl>
  197. <dl class="method">
  198. <dt id="_f.Frm.sec_section">
  199. <tt class="descname">sec_section</tt><big>(</big><em>sec_id</em><big>)</big><a class="headerlink" href="#_f.Frm.sec_section" title="Permalink to this definition">¶</a></dt>
  200. <dd>Show the section identified by</dd></dl>
  201. <dl class="method">
  202. <dt id="_f.Frm.refresh">
  203. <tt class="descname">refresh</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.refresh" title="Permalink to this definition">¶</a></dt>
  204. <dd><p>Refresh the current form. It will</p>
  205. <ul class="simple">
  206. <li>Check permission</li>
  207. <li>If the record is changed, load the new record data</li>
  208. <li>Run &#8216;refresh&#8217; method</li>
  209. <li>Refresh all fields</li>
  210. <li>Show the form</li>
  211. </ul>
  212. </dd></dl>
  213. <dl class="method">
  214. <dt id="_f.Frm.refresh_fields">
  215. <tt class="descname">refresh_fields</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.refresh_fields" title="Permalink to this definition">¶</a></dt>
  216. <dd>Will refresh all fields</dd></dl>
  217. <dl class="method">
  218. <dt id="_f.Frm.refresh_dependancy">
  219. <tt class="descname">refresh_dependancy</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.refresh_dependancy" title="Permalink to this definition">¶</a></dt>
  220. <dd>Will refresh hide / show based on &#8216;depends_on&#8217;</dd></dl>
  221. <dl class="method">
  222. <dt id="_f.Frm.save">
  223. <tt class="descname">save</tt><big>(</big><em>save_action</em>, <em>call_back</em><big>)</big><a class="headerlink" href="#_f.Frm.save" title="Permalink to this definition">¶</a></dt>
  224. <dd><p>Will save the current record (function called from the &#8220;Save&#8221; button)</p>
  225. <p>save_action can be <cite>Save</cite>, <cite>Submit</cite>, <cite>Cancel</cite></p>
  226. </dd></dl>
  227. <dl class="method">
  228. <dt id="_f.Frm.print_doc">
  229. <tt class="descname">print_doc</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.print_doc" title="Permalink to this definition">¶</a></dt>
  230. <dd>Show the <cite>Print</cite> dialog</dd></dl>
  231. <dl class="method">
  232. <dt id="_f.Frm.email_doc">
  233. <tt class="descname">email_doc</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.email_doc" title="Permalink to this definition">¶</a></dt>
  234. <dd>Shows the <cite>Email</cite> dialog</dd></dl>
  235. <dl class="method">
  236. <dt id="_f.Frm.copy_doc">
  237. <tt class="descname">copy_doc</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.copy_doc" title="Permalink to this definition">¶</a></dt>
  238. <dd>Copy the current record</dd></dl>
  239. <dl class="method">
  240. <dt id="_f.Frm.reload_doc">
  241. <tt class="descname">reload_doc</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.reload_doc" title="Permalink to this definition">¶</a></dt>
  242. <dd>Reload the current record from the server</dd></dl>
  243. <dl class="method">
  244. <dt id="_f.Frm.amend_doc">
  245. <tt class="descname">amend_doc</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.amend_doc" title="Permalink to this definition">¶</a></dt>
  246. <dd>Amend the current Cancelled record</dd></dl>
  247. <dl class="method">
  248. <dt id="_f.Frm.check_required">
  249. <tt class="descname">check_required</tt><big>(</big><em>dt</em>, <em>dn</em><big>)</big><a class="headerlink" href="#_f.Frm.check_required" title="Permalink to this definition">¶</a></dt>
  250. <dd>Checks whether all mandatory fields are filled</dd></dl>
  251. <dl class="method">
  252. <dt id="_f.Frm.runscript">
  253. <tt class="descname">runscript</tt><big>(</big><em>scriptname</em>, <em>callingfield</em>, <em>onrefresh</em><big>)</big><a class="headerlink" href="#_f.Frm.runscript" title="Permalink to this definition">¶</a></dt>
  254. <dd>Run a server-side script where Trigger is set as <cite>Server</cite>. The server method is identified by
  255. <cite>scriptname</cite></dd></dl>
  256. <dl class="method">
  257. <dt id="_f.Frm.runclientscript">
  258. <tt class="descname">runclientscript</tt><big>(</big><em>caller</em>, <em>cdt</em>, <em>cdn</em><big>)</big><a class="headerlink" href="#_f.Frm.runclientscript" title="Permalink to this definition">¶</a></dt>
  259. <dd>Run a client script identified by the calling fieldname <cite>caller</cite>. <cite>cdt</cite> and <cite>cdn</cite> are the
  260. id of the calling <cite>DocType and `name</cite></dd></dl>
  261. <dl class="method">
  262. <dt id="_f.Frm.set_tip">
  263. <tt class="descname">set_tip</tt><big>(</big><em>txt</em><big>)</big><a class="headerlink" href="#_f.Frm.set_tip" title="Permalink to this definition">¶</a></dt>
  264. <dd>Clear existing tips and set a new tip (contextual help) in the Form</dd></dl>
  265. <dl class="method">
  266. <dt id="_f.Frm.append_tip">
  267. <tt class="descname">append_tip</tt><big>(</big><em>txt</em><big>)</big><a class="headerlink" href="#_f.Frm.append_tip" title="Permalink to this definition">¶</a></dt>
  268. <dd>Add another tip to the existing tips</dd></dl>
  269. <dl class="method">
  270. <dt id="_f.Frm.clear_tip">
  271. <tt class="descname">clear_tip</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Frm.clear_tip" title="Permalink to this definition">¶</a></dt>
  272. <dd>Clear all tips</dd></dl>
  273. </dd></dl>
  274. </div>
  275. <div class="section" id="field-class">
  276. <h2>Field Class<a class="headerlink" href="#field-class" title="Permalink to this headline">¶</a></h2>
  277. <dl class="class">
  278. <dt id="_f.Field">
  279. <em class="property">class </em><tt class="descclassname">_f.</tt><tt class="descname">Field</tt><a class="headerlink" href="#_f.Field" title="Permalink to this definition">¶</a></dt>
  280. <dd><dl class="attribute">
  281. <dt id="_f.Field.df">
  282. <tt class="descname">df</tt><a class="headerlink" href="#_f.Field.df" title="Permalink to this definition">¶</a></dt>
  283. <dd><p>the <cite>df</cite> attribute represents the Field data. Standard Field properties are</p>
  284. <ul class="simple">
  285. <li>fieldname</li>
  286. <li>fieldtype</li>
  287. <li>options</li>
  288. <li>permlevel</li>
  289. <li>description</li>
  290. <li>reqd</li>
  291. <li>hidden</li>
  292. <li>search_index</li>
  293. </ul>
  294. <p>Example:</p>
  295. <div class="highlight-python"><pre>var field = cur_frm.fields_dict['first_name']
  296. field.df.reqd = 1;
  297. field.refresh();</pre>
  298. </div>
  299. </dd></dl>
  300. <dl class="attribute">
  301. <dt id="_f.Field.wrapper">
  302. <tt class="descname">wrapper</tt><a class="headerlink" href="#_f.Field.wrapper" title="Permalink to this definition">¶</a></dt>
  303. <dd>Wrapping DIV Element</dd></dl>
  304. <dl class="attribute">
  305. <dt id="_f.Field.label_area">
  306. <tt class="descname">label_area</tt><a class="headerlink" href="#_f.Field.label_area" title="Permalink to this definition">¶</a></dt>
  307. <dd>HTML Element where the label of the field is printed</dd></dl>
  308. <dl class="attribute">
  309. <dt id="_f.Field.disp_area">
  310. <tt class="descname">disp_area</tt><a class="headerlink" href="#_f.Field.disp_area" title="Permalink to this definition">¶</a></dt>
  311. <dd>HTML Element where the value of the field is printed in &#8220;Read&#8221; mode</dd></dl>
  312. <dl class="attribute">
  313. <dt id="_f.Field.input_area">
  314. <tt class="descname">input_area</tt><a class="headerlink" href="#_f.Field.input_area" title="Permalink to this definition">¶</a></dt>
  315. <dd>HTML Element where the widget is placed in &#8220;Write&#8221; mode</dd></dl>
  316. <dl class="attribute">
  317. <dt id="_f.Field.comment_area">
  318. <tt class="descname">comment_area</tt><a class="headerlink" href="#_f.Field.comment_area" title="Permalink to this definition">¶</a></dt>
  319. <dd>HTML Element where the comment (description) is printed</dd></dl>
  320. <dl class="attribute">
  321. <dt id="_f.Field.parent_section">
  322. <tt class="descname">parent_section</tt><a class="headerlink" href="#_f.Field.parent_section" title="Permalink to this definition">¶</a></dt>
  323. <dd>If the <cite>section_style</cite> of the doctype is <cite>Tray</cite> or <cite>Tabbed</cite>, then this represents the SectionBreak
  324. object in which this field is. This is used to switch to the section in case of an error.</dd></dl>
  325. <dl class="method">
  326. <dt id="_f.Field.get_status">
  327. <tt class="descname">get_status</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Field.get_status" title="Permalink to this definition">¶</a></dt>
  328. <dd>Retuns the whether the field has permission to <cite>Read</cite>, <cite>Write</cite> or <cite>None</cite></dd></dl>
  329. <dl class="method">
  330. <dt id="_f.Field.set">
  331. <tt class="descname">set</tt><big>(</big><em>v</em><big>)</big><a class="headerlink" href="#_f.Field.set" title="Permalink to this definition">¶</a></dt>
  332. <dd>Sets a value to the field. Value is set in <cite>locals</cite> and the widget</dd></dl>
  333. <dl class="method">
  334. <dt id="_f.Field.run_trigger">
  335. <tt class="descname">run_trigger</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.Field.run_trigger" title="Permalink to this definition">¶</a></dt>
  336. <dd>Runs any client / server triggers. Called <cite>onchange</cite></dd></dl>
  337. </dd></dl>
  338. </div>
  339. <div class="section" id="grid-class">
  340. <h2>Grid Class<a class="headerlink" href="#grid-class" title="Permalink to this headline">¶</a></h2>
  341. <dl class="class">
  342. <dt id="_f.FormGrid">
  343. <em class="property">class </em><tt class="descclassname">_f.</tt><tt class="descname">FormGrid</tt><a class="headerlink" href="#_f.FormGrid" title="Permalink to this definition">¶</a></dt>
  344. <dd><p>The FromGrid Class inherits from the Grid class. The Grid class was designed to be a generic INPUT.</p>
  345. <ul class="simple">
  346. <li>The metadata of the grid is defined by the <cite>DocType</cite> of the <cite>Table</cite> field.</li>
  347. <li>Each column of the grid represents a field.</li>
  348. <li>Each row of the grid represents a record</li>
  349. </ul>
  350. <p><strong>Grid Types</strong></p>
  351. <p>There are two type of Grids:</p>
  352. <ol class="arabic simple">
  353. <li>Standard: Where fields can be edited within the cell</li>
  354. <li>Simple: Where fields are edited in a popup Dialog box. A Simple Grid can be created by setting the
  355. <cite>default</cite> property of the Table field to &#8220;Simple&#8221;</li>
  356. </ol>
  357. <p>When the user clicks on an editable Grid cell, it adds an <cite>Field</cite> object of that particular column to the
  358. cell so that the user can edit the values inside the cell. This <cite>Field</cite> object is known as the <cite>template</cite>
  359. The <cite>template</cite> can be accessed by the <cite>get_field</cite> method</p>
  360. <dl class="method">
  361. <dt id="_f.FormGrid.get_field">
  362. <tt class="descname">get_field</tt><big>(</big><em>fieldname</em><big>)</big><a class="headerlink" href="#_f.FormGrid.get_field" title="Permalink to this definition">¶</a></dt>
  363. <dd>Returns the <cite>template</cite> (<cite>Field</cite> object) identified by <cite>fieldname</cite></dd></dl>
  364. <dl class="method">
  365. <dt id="_f.FormGrid.refresh">
  366. <tt class="descname">refresh</tt><big>(</big><big>)</big><a class="headerlink" href="#_f.FormGrid.refresh" title="Permalink to this definition">¶</a></dt>
  367. <dd>Refresh all data in the Grid</dd></dl>
  368. </dd></dl>
  369. </div>
  370. <div class="section" id="examples">
  371. <h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. <div class="clearer"></div>
  378. </div>
  379. <div class="related">
  380. <h3>Navigation</h3>
  381. <ul>
  382. <li class="right" style="margin-right: 10px">
  383. <a href="genindex.html" title="General Index"
  384. >index</a></li>
  385. <li class="right" >
  386. <a href="modindex.html" title="Global Module Index"
  387. >modules</a> |</li>
  388. <li class="right" >
  389. <a href="report_builder.html" title="Report Builder"
  390. >next</a> |</li>
  391. <li class="right" >
  392. <a href="local_data.html" title="Accessing Local Data"
  393. >previous</a> |</li>
  394. <li><a href="index.html">Documentation</a> &raquo;</li>
  395. <li><a href="client_side_widgets.html" >4. Client Side API</a> &raquo;</li>
  396. </ul>
  397. </div>
  398. <div class="footer">
  399. &copy; Copyright 2010, Rushabh Mehta.
  400. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
  401. </div>
  402. </body>
  403. </html>