PageRenderTime 39ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/1.4/docs/html/api/mvc/sync.html

https://github.com/yiminghe/kissyteam.github.com
HTML | 286 lines | 242 code | 26 blank | 18 comment | 0 complexity | 598b0a9ace4bc9e7f1d1e8379c65d12c MD5 | raw file
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta name="viewport"
  6. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  7. <meta name="data-spm" content="1" data-spm-protocol="i" />
  8. <title>mvc.sync &mdash; KISSY v1.4 Documentation</title>
  9. <link rel="stylesheet" href="//g.alicdn.com/kissy/k/1.4.7/css/dpl/base-min.css"/>
  10. <link rel="stylesheet" href="http://a.tbcdn.cn/s/kissy/gallery/sphinx/1.1.3/pygments.css" type="text/css" />
  11. <link rel="shortcut icon" href="http://a.tbcdn.cn/s/kissy/favicon.ico" type="image/x-icon" />
  12. <script>
  13. var DOCUMENTATION_OPTIONS = {
  14. URL_ROOT: '../../',
  15. VERSION: '',
  16. COLLAPSE_INDEX: false,
  17. FILE_SUFFIX: '.html',
  18. HAS_SOURCE: true
  19. };
  20. </script>
  21. <script type="text/javascript" src="http://a.tbcdn.cn/s/kissy/gallery/sphinx/1.1.3/??jquery.js,underscore.js,doctools.js,searchtools.js"></script>
  22. <script>
  23. var _gaq = _gaq || [];
  24. _gaq.push(['_setAccount', 'UA-31470541-1']);
  25. _gaq.push(['_trackPageview']);
  26. (function() {
  27. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  28. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  29. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  30. })();
  31. </script>
  32. <link rel="stylesheet" href="../../_static/kissy.css"/>
  33. <link rel="stylesheet" href="../../_static/prettify.css"/>
  34. <link rel="stylesheet" href="../../_static/forkit.css"/>
  35. <link rel="stylesheet" href="../../_static/bootstrap.css"/>
  36. <script src="//g.alicdn.com/kissy/k/1.4.7/seed.js"></script>
  37. </head>
  38. <body data-spy="scroll" data-target=".bs-docs-sidebar">
  39. <nav id="sidebar">
  40. <header>
  41. <a href="/" >
  42. <img src="http://gtms01.alicdn.com/tps/i1/T1MVbxFoRcXXchhRni-175-68.png" alt="" />
  43. </a>
  44. </header>
  45. <div class="col-sub"><ul class="s-box api-toctree">
  46. <h4 class="s-box-hd">Seed</h4>
  47. <ul class="s-box-bd">
  48. <li><a href="../features/index.html">features</a></li>
  49. <li><a href="../lang/index.html">lang</a></li>
  50. <li><a href="../loader/index.html">loader</a></li>
  51. <li><a href="../ua/index.html">ua</a></li>
  52. </ul>
  53. </ul>
  54. <ul class="s-box component-toctree">
  55. <h4 class="s-box-hd">Core</h4>
  56. <ul class="s-box-bd">
  57. <li><a href="../anim/index.html">anim</a></li>
  58. <li><a href="../base/index.html">base</a></li>
  59. <li><a href="../cookie/index.html">cookie</a></li>
  60. <li><a href="../dom/index.html">dom</a></li>
  61. <li><a href="../event/index.html">event</a></li>
  62. <li><a href="../io/index.html">io</a></li>
  63. <li><a href="../json/index.html">json</a></li>
  64. <li><a href="../node/index.html">node</a></li>
  65. <li><a href="../path/index.html">path</a></li>
  66. <li><a href="../promise/index.html">promise</a></li>
  67. <li><a href="../uri/index.html">uri</a></li>
  68. </ul>
  69. </ul>
  70. <ul class="s-box component-toctree">
  71. <h4 class="s-box-hd">Infrastructure</h4>
  72. <ul class="s-box-bd">
  73. <li><a href="../component/index.html">component</a></li>
  74. <li><a href="index.html">mvc</a></li>
  75. <li><a href="../xtemplate/index.html">xtemplate</a></li>
  76. </ul>
  77. </ul>
  78. <ul class="s-box component-toctree">
  79. <h4 class="s-box-hd">Components</h4>
  80. <ul class="s-box-bd">
  81. <li><a href="../button/index.html">button</a></li>
  82. <li><a href="../color/index.html">color</a></li>
  83. <li><a href="../combobox/index.html">combobox</a></li>
  84. <li><a href="../date/index.html">date</a></li>
  85. <li><a href="../dd/index.html">dd</a></li>
  86. <li><a href="../editor/index.html">editor</a></li>
  87. <li><a href="../filter-menu/index.html">filter-menu</a></li>
  88. <li><a href="../menu/index.html">menu</a></li>
  89. <li><a href="../menubutton/index.html">menubutton</a></li>
  90. <li><a href="../overlay/index.html">overlay</a></li>
  91. <li><a href="../resizable/index.html">resizable</a></li>
  92. <li><a href="../scroll-view/index.html">scroll-view</a></li>
  93. <li><a href="../split-button/index.html">split-button</a></li>
  94. <li><a href="../stylesheet/index.html">stylesheet</a></li>
  95. <li><a href="../swf/index.html">swf</a></li>
  96. <li><a href="../tabs/index.html">tabs</a></li>
  97. <li><a href="../toolbar/index.html">toolbar</a></li>
  98. <li><a href="../tree/index.html">tree</a></li>
  99. </ul>
  100. </ul>
  101. </div>
  102. <div id="searchbox" class="searchbox">
  103. <form class="search" action="../../search.html" method="get">
  104. <input type="text" name="q" size="28" class="ipt"/>
  105. <input type="submit" value="Go" class="btn"/>
  106. <input type="hidden" name="check_keywords" value="yes"/>
  107. <input type="hidden" name="area" value="default"/>
  108. </form>
  109. </div>
  110. </nav>
  111. <div id="content" class="body">
  112. <article>
  113. <ul class="api-header clearfix">
  114. <li class="first">
  115. <a href="/" >
  116. 首页
  117. </a>
  118. </li>
  119. <li><a href="../../../../docs/html/api/index.html">API</a></li>
  120. <li><a href="../../../../docs/html/demo/index.html">Demo</a></li>
  121. <li>
  122. <a href="../../../../docs/html/guideline/get-started.html" >
  123. Guideline
  124. </a>
  125. </li>
  126. <li><a href="../../../../docs/html/tutorials/index.html">Tutorials</a></li>
  127. <li><a href="https://groups.google.com/group/kissy-ui">Google Group</a></li>
  128. <li style="float:right"><a href="https://github.com/kissyteam/kissy">Source Code</a></li>
  129. <li style="float:right"><a href="/1.4/api/">English API Docs</a></li>
  130. <li style="float:right" class="first"><a href="http://blog.kissyui.com">KISSY Blog</a></li>
  131. </ul>
  132. <div class='related'>
  133. <h3>Navigation</h3>
  134. <ul>
  135. <li class="right" style="margin-right: 10px">
  136. <a href="../../genindex.html" title="General Index"
  137. accesskey="I">index</a></li>
  138. <li class="right" >
  139. <a href="../../py-modindex.html" title="Python Module Index"
  140. >modules</a> | </li>
  141. <li class="right" >
  142. <a href="../swf/index.html" title="SWF"
  143. accesskey="N">next</a> | </li>
  144. <li class="right" >
  145. <a href="Router.html" title="mvc.Router"
  146. accesskey="P">previous</a> | </li>
  147. <li><a href="../../index.html">KISSY v1.4 Documentation</a> &#187; </li>
  148. <li><a href="../index.html" >API Documentation</a> &#187; </li>
  149. <li><a href="index.html" accesskey="U">mvc</a> &#187; </li>
  150. </ul>
  151. </div>
  152. <div class="section" id="mvc-sync">
  153. <h1>mvc.sync<a class="headerlink" href="#mvc-sync" title="Permalink to this headline"></a></h1>
  154. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="s1">&#39;mvc&#39;</span><span class="p">,</span><span class="kd">function</span><span class="p">(</span><span class="nx">S</span><span class="p">,</span><span class="nx">mvc</span><span class="p">){</span>
  155. <span class="c1">// use mvc.sync</span>
  156. <span class="p">});</span>
  157. </pre></div>
  158. </div>
  159. <div class="line-block">
  160. <div class="line">同步函数.</div>
  161. </div>
  162. <dl class="function">
  163. <dt id="mvc.mvc.sync">
  164. <tt class="descclassname">mvc.</tt><tt class="descname">sync</tt><big>(</big><big>)</big><a class="headerlink" href="#mvc.mvc.sync" title="Permalink to this definition"></a></dt>
  165. <dd><div class="line-block">
  166. <div class="line"><strong>sync( self , method , opts )</strong></div>
  167. <div class="line">集合或模型发生改变时调用的函数</div>
  168. </div>
  169. <table class="docutils field-list" frame="void" rules="none">
  170. <col class="field-name" />
  171. <col class="field-body" />
  172. <tbody valign="top">
  173. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  174. <li><strong>self</strong> (<em>Model|Collection</em>) &#8211; 当前动作的所处对象</li>
  175. <li><strong>method</strong> (<em>String</em>) &#8211; <p>同步的具体动作包括</p>
  176. <ol class="arabic">
  177. <li>create 创建动作</li>
  178. <li>update 更新动作</li>
  179. <li>delete 删除动作</li>
  180. <li>read 读取动作</li>
  181. </ol>
  182. </li>
  183. <li><strong>opts</strong> (<em>Object</em>) &#8211; <p>控制选项包括</p>
  184. <dl class="attribute">
  185. <dt id="mvc.mvc.sync.opts.success">
  186. <tt class="descclassname">mvc.sync.opts.</tt><tt class="descname">success</tt><a class="headerlink" href="#mvc.mvc.sync.opts.success" title="Permalink to this definition"></a></dt>
  187. <dd><p>操作成功后的回调</p>
  188. </dd></dl>
  189. <dl class="attribute">
  190. <dt id="mvc.mvc.sync.opts.error">
  191. <tt class="descclassname">mvc.sync.opts.</tt><tt class="descname">error</tt><a class="headerlink" href="#mvc.mvc.sync.opts.error" title="Permalink to this definition"></a></dt>
  192. <dd><p>操作失败后的回调</p>
  193. </dd></dl>
  194. <dl class="attribute">
  195. <dt id="mvc.mvc.sync.opts.complete">
  196. <tt class="descclassname">mvc.sync.opts.</tt><tt class="descname">complete</tt><a class="headerlink" href="#mvc.mvc.sync.opts.complete" title="Permalink to this definition"></a></dt>
  197. <dd><p>操作完成后的回调成功或失败</p>
  198. </dd></dl>
  199. </li>
  200. </ul>
  201. </td>
  202. </tr>
  203. </tbody>
  204. </table>
  205. </dd></dl>
  206. <div class="admonition note">
  207. <p class="first admonition-title">Note</p>
  208. <p class="last">系统自带的该函数会自动发请求给模型或集合对应的 url 函数返回的值如果有特殊需要可以进行覆盖</p>
  209. </div>
  210. </div>
  211. <div id="disqus_thread"></div>
  212. <script>
  213. if((window.location.hostname.indexOf("kissyui.com")!=-1 )&& window.localStorage.getItem("kissy-commment")!="0"){
  214. /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
  215. var disqus_shortname = 'kissy-docs'; // required: replace example with your forum shortname
  216. // The following are highly recommended additional parameters. Remove the slashes in front to use.
  217. //var disqus_identifier = '/anim';
  218. //var disqus_url = window.location;
  219. /* * * DON'T EDIT BELOW THIS LINE * * */
  220. (function() {
  221. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  222. dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  223. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  224. })();
  225. }
  226. </script>
  227. <!--<div id="google-search-box">
  228. <div id="cse" style="width: 100%;">Loading</div>
  229. <script>
  230. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  231. document.write('<script src="http://www.google.com/jsapi" type="text/javascript"><'+'/script>');
  232. }
  233. </script>
  234. <script>
  235. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  236. google.load('search', '1', {language : 'zh-CN', style : google.loader.themes.MINIMALIST});
  237. google.setOnLoadCallback(function() {
  238. var customSearchControl = new google.search.CustomSearchControl('012347804910294994683:n4uzb24gqdm');
  239. customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
  240. customSearchControl.draw('cse');
  241. }, true);
  242. }
  243. </script>
  244. </div>-->
  245. </article>
  246. </div>
  247. <footer class="footer">
  248. <p>&copy; Copyright 2010~2014, KISSY Team. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a></p>
  249. </footer></body>
  250. <script>
  251. // added by jayli
  252. (function(){
  253. $('table.docutils').addClass('table table-bordered');
  254. $('.admonition.note').addClass('alert alert-info');
  255. $('.admonition.hint').addClass('alert alert-success');
  256. $('.admonition.warning').addClass('alert alert-warning');
  257. $('.admonition.attention').addClass('alert alert-danger');
  258. })();
  259. </script>
  260. </html>