gridx-rails 1.2.1 → 1.3.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (327) hide show
  1. checksums.yaml +9 -9
  2. data/app/assets/images/gridx/resources/images/headershadow.png +0 -0
  3. data/app/assets/images/gridx/resources/images/rowback.png +0 -0
  4. data/app/assets/images/gridx/resources/images/sprite.png +0 -0
  5. data/app/assets/javascripts/gridx/Grid.js +20 -3
  6. data/app/assets/javascripts/gridx/allModules.js +18 -4
  7. data/app/assets/javascripts/gridx/core/Core.js +36 -6
  8. data/app/assets/javascripts/gridx/core/model/Model.js +6 -5
  9. data/app/assets/javascripts/gridx/core/model/cache/Async.js +9 -7
  10. data/app/assets/javascripts/gridx/core/model/cache/Sync.js +414 -12
  11. data/app/assets/javascripts/gridx/core/model/extensions/Mark.js +14 -20
  12. data/app/assets/javascripts/gridx/core/model/extensions/Modify.js +3 -10
  13. data/app/assets/javascripts/gridx/modules/AutoPagedBody.js +100 -0
  14. data/app/assets/javascripts/gridx/modules/AutoScroll.js +92 -23
  15. data/app/assets/javascripts/gridx/modules/Bar.js +14 -1
  16. data/app/assets/javascripts/gridx/modules/Body.js +64 -29
  17. data/app/assets/javascripts/gridx/modules/CellWidget.js +5 -2
  18. data/app/assets/javascripts/gridx/modules/ColumnLock.js +1 -2
  19. data/app/assets/javascripts/gridx/modules/ColumnWidth.js +4 -1
  20. data/app/assets/javascripts/gridx/modules/Dod.js +216 -12
  21. data/app/assets/javascripts/gridx/modules/Edit.js +143 -68
  22. data/app/assets/javascripts/gridx/modules/ExpandableColumn.js +292 -0
  23. data/app/assets/javascripts/gridx/modules/Filter.js +14 -0
  24. data/app/assets/javascripts/gridx/modules/Focus.js +9 -3
  25. data/app/assets/javascripts/gridx/modules/Header.js +22 -12
  26. data/app/assets/javascripts/gridx/modules/HeaderRegions.js +23 -8
  27. data/app/assets/javascripts/gridx/modules/IndirectSelect.js +6 -7
  28. data/app/assets/javascripts/gridx/modules/IndirectSelectColumn.js +1 -1
  29. data/app/assets/javascripts/gridx/modules/Layer.js +358 -0
  30. data/app/assets/javascripts/gridx/modules/NestedSort.js +8 -10
  31. data/app/assets/javascripts/gridx/modules/PagedBody.js +22 -323
  32. data/app/assets/javascripts/gridx/modules/Puller.js +113 -0
  33. data/app/assets/javascripts/gridx/modules/RowHeader.js +7 -6
  34. data/app/assets/javascripts/gridx/modules/RowLock.js +49 -19
  35. data/app/assets/javascripts/gridx/modules/SlantedHeader.js +46 -0
  36. data/app/assets/javascripts/gridx/modules/Sort.js +417 -0
  37. data/app/assets/javascripts/gridx/modules/StructureSwitch.js +143 -0
  38. data/app/assets/javascripts/gridx/modules/SummaryBar.js +6 -1
  39. data/app/assets/javascripts/gridx/modules/TouchVScroller.js +36 -13
  40. data/app/assets/javascripts/gridx/modules/Tree.js +6 -8
  41. data/app/assets/javascripts/gridx/modules/VScroller.js +1 -1
  42. data/app/assets/javascripts/gridx/modules/View.js +25 -18
  43. data/app/assets/javascripts/gridx/modules/VirtualVScroller.js +23 -11
  44. data/app/assets/javascripts/gridx/modules/_PagedBodyMixin.js +351 -0
  45. data/app/assets/javascripts/gridx/modules/dnd/Avatar.js +1 -1
  46. data/app/assets/javascripts/gridx/modules/dnd/_Dnd.js +1 -0
  47. data/app/assets/javascripts/gridx/modules/extendedSelect/Row.js +8 -5
  48. data/app/assets/javascripts/gridx/modules/filter/FilterBar.js +24 -17
  49. data/app/assets/javascripts/gridx/modules/filter/FilterConfirmDialog.js +3 -1
  50. data/app/assets/javascripts/gridx/modules/filter/FilterDialog.js +2 -2
  51. data/app/assets/javascripts/gridx/modules/filter/FilterPane.js +4 -5
  52. data/app/assets/javascripts/gridx/modules/filter/FilterTooltip.js +1 -1
  53. data/app/assets/javascripts/gridx/modules/filter/QuickFilter.js +32 -9
  54. data/app/assets/javascripts/gridx/modules/pagination/_PaginationBarBase.js +4 -1
  55. data/app/assets/javascripts/gridx/modules/select/Row.js +8 -4
  56. data/app/assets/javascripts/gridx/nls/ar/{FilterBar.js → gridx.js} +77 -5
  57. data/app/assets/javascripts/gridx/nls/bg/{FilterBar.js → gridx.js} +71 -5
  58. data/app/assets/javascripts/gridx/nls/ca/{FilterBar.js → gridx.js} +71 -5
  59. data/app/assets/javascripts/gridx/nls/cs/{FilterBar.js → gridx.js} +77 -5
  60. data/app/assets/javascripts/gridx/nls/da/{FilterBar.js → gridx.js} +77 -5
  61. data/app/assets/javascripts/gridx/nls/de/{FilterBar.js → gridx.js} +77 -5
  62. data/app/assets/javascripts/gridx/nls/el/{FilterBar.js → gridx.js} +77 -5
  63. data/app/assets/javascripts/gridx/nls/es/{FilterBar.js → gridx.js} +71 -5
  64. data/app/assets/javascripts/gridx/nls/fi/{FilterBar.js → gridx.js} +77 -5
  65. data/app/assets/javascripts/gridx/nls/fr/{FilterBar.js → gridx.js} +77 -5
  66. data/app/assets/javascripts/gridx/nls/{FilterBar.js → gridx.js} +80 -4
  67. data/app/assets/javascripts/gridx/nls/he/{FilterBar.js → gridx.js} +77 -5
  68. data/app/assets/javascripts/gridx/nls/hr/{FilterBar.js → gridx.js} +77 -5
  69. data/app/assets/javascripts/gridx/nls/hu/{FilterBar.js → gridx.js} +77 -5
  70. data/app/assets/javascripts/gridx/nls/it/{FilterBar.js → gridx.js} +77 -5
  71. data/app/assets/javascripts/gridx/nls/ja/{FilterBar.js → gridx.js} +77 -5
  72. data/app/assets/javascripts/gridx/nls/kk/{FilterBar.js → gridx.js} +76 -5
  73. data/app/assets/javascripts/gridx/nls/ko/{FilterBar.js → gridx.js} +81 -5
  74. data/app/assets/javascripts/gridx/nls/nb/{FilterBar.js → gridx.js} +77 -5
  75. data/app/assets/javascripts/gridx/nls/nl/{FilterBar.js → gridx.js} +77 -5
  76. data/app/assets/javascripts/gridx/nls/pl/{FilterBar.js → gridx.js} +77 -5
  77. data/app/assets/javascripts/gridx/nls/pt/{FilterBar.js → gridx.js} +71 -5
  78. data/app/assets/javascripts/gridx/nls/pt-pt/{FilterBar.js → gridx.js} +71 -5
  79. data/app/assets/javascripts/gridx/nls/ro/{FilterBar.js → gridx.js} +71 -5
  80. data/app/assets/javascripts/gridx/nls/ru/{FilterBar.js → gridx.js} +77 -5
  81. data/app/assets/javascripts/gridx/nls/sk/{FilterBar.js → gridx.js} +71 -5
  82. data/app/assets/javascripts/gridx/nls/sl/{FilterBar.js → gridx.js} +77 -5
  83. data/app/assets/javascripts/gridx/nls/sv/{FilterBar.js → gridx.js} +77 -5
  84. data/app/assets/javascripts/gridx/nls/th/{FilterBar.js → gridx.js} +77 -5
  85. data/app/assets/javascripts/gridx/nls/tr/{FilterBar.js → gridx.js} +77 -5
  86. data/app/assets/javascripts/gridx/nls/uk/{FilterBar.js → gridx.js} +71 -5
  87. data/app/assets/javascripts/gridx/nls/zh/{FilterBar.js → gridx.js} +77 -5
  88. data/app/assets/javascripts/gridx/nls/zh-tw/{FilterBar.js → gridx.js} +77 -5
  89. data/app/assets/javascripts/gridx/nls/zz-ZZ/gridx.js +173 -0
  90. data/app/assets/javascripts/gridx/support/DropDownPager.js +3 -5
  91. data/app/assets/javascripts/gridx/support/DropDownSizer.js +3 -5
  92. data/app/assets/javascripts/gridx/support/GotoPagePane.js +3 -5
  93. data/app/assets/javascripts/gridx/support/QuickFilter.js +3 -5
  94. data/app/assets/javascripts/gridx/support/Summary.js +32 -10
  95. data/app/assets/javascripts/gridx/support/_LinkPageBase.js +3 -5
  96. data/app/assets/javascripts/gridx/support/query.js +47 -0
  97. data/app/assets/javascripts/gridx/templates/FilterBar.html +1 -1
  98. data/app/assets/javascripts/gridx/templates/QuickFilter.html +3 -3
  99. data/app/assets/stylesheets/gridx/resources/Gridx.css +1 -10
  100. data/app/assets/stylesheets/gridx/resources/claro/Gridx.css +1 -16
  101. data/app/assets/stylesheets/gridx/resources/slantedHeader.css +90 -0
  102. data/lib/gridx-rails/version.rb +1 -1
  103. data/lib/tasks/gridx-rails_tasks.rake +1 -1
  104. data/test/dummy/log/test.log +5 -0
  105. metadata +52 -260
  106. data/app/assets/images/gridx/resources/images/checkboxpartial.png +0 -0
  107. data/app/assets/images/gridx/resources/images/checkboxpartialdisabled.png +0 -0
  108. data/app/assets/images/gridx/resources/images/dndCopy.png +0 -0
  109. data/app/assets/images/gridx/resources/images/dndMove.png +0 -0
  110. data/app/assets/images/gridx/resources/images/dndNoCopy.png +0 -0
  111. data/app/assets/images/gridx/resources/images/dndNoMove.png +0 -0
  112. data/app/assets/images/gridx/resources/images/gridxCellChanged.png +0 -0
  113. data/app/assets/images/gridx/resources/images/header.png +0 -0
  114. data/app/assets/images/gridx/resources/images/header_shadow.png +0 -0
  115. data/app/assets/images/gridx/resources/images/row_back.png +0 -0
  116. data/app/assets/images/gridx/resources/images/row_back_changed.png +0 -0
  117. data/app/assets/images/gridx/resources/images/sprite_icons.png +0 -0
  118. data/app/assets/images/gridx/resources/images/treeExpandImages.png +0 -0
  119. data/app/assets/javascripts/gridx/core/model/cache/_Cache.js +0 -403
  120. data/app/assets/javascripts/gridx/core/util.js +0 -13
  121. data/app/assets/javascripts/gridx/modules/Printer.js +0 -49
  122. data/app/assets/javascripts/gridx/modules/TitleBar.js +0 -51
  123. data/app/assets/javascripts/gridx/modules/barPlugins/DropDownPager.js +0 -16
  124. data/app/assets/javascripts/gridx/modules/barPlugins/DropDownSizer.js +0 -16
  125. data/app/assets/javascripts/gridx/modules/barPlugins/GotoPageButton.js +0 -16
  126. data/app/assets/javascripts/gridx/modules/barPlugins/LinkPager.js +0 -16
  127. data/app/assets/javascripts/gridx/modules/barPlugins/LinkSizer.js +0 -16
  128. data/app/assets/javascripts/gridx/modules/barPlugins/Summary.js +0 -16
  129. data/app/assets/javascripts/gridx/modules/exporter/CSV.js +0 -43
  130. data/app/assets/javascripts/gridx/modules/exporter/Exporter.js +0 -34
  131. data/app/assets/javascripts/gridx/modules/exporter/Table.js +0 -42
  132. data/app/assets/javascripts/gridx/modules/filter/Filter.js +0 -16
  133. data/app/assets/javascripts/gridx/modules/pagination/Pagination.js +0 -16
  134. data/app/assets/javascripts/gridx/nls/Body.js +0 -47
  135. data/app/assets/javascripts/gridx/nls/NestedSort.js +0 -45
  136. data/app/assets/javascripts/gridx/nls/PaginationBar.js +0 -68
  137. data/app/assets/javascripts/gridx/nls/QuickFilter.js +0 -40
  138. data/app/assets/javascripts/gridx/nls/SummaryBar.js +0 -38
  139. data/app/assets/javascripts/gridx/nls/ar/Body.js +0 -11
  140. data/app/assets/javascripts/gridx/nls/ar/NestedSort.js +0 -11
  141. data/app/assets/javascripts/gridx/nls/ar/PaginationBar.js +0 -34
  142. data/app/assets/javascripts/gridx/nls/ar/QuickFilter.js +0 -7
  143. data/app/assets/javascripts/gridx/nls/ar/SummaryBar.js +0 -5
  144. data/app/assets/javascripts/gridx/nls/bg/Body.js +0 -11
  145. data/app/assets/javascripts/gridx/nls/bg/NestedSort.js +0 -12
  146. data/app/assets/javascripts/gridx/nls/bg/PaginationBar.js +0 -28
  147. data/app/assets/javascripts/gridx/nls/bg/QuickFilter.js +0 -8
  148. data/app/assets/javascripts/gridx/nls/bg/SummaryBar.js +0 -6
  149. data/app/assets/javascripts/gridx/nls/ca/Body.js +0 -11
  150. data/app/assets/javascripts/gridx/nls/ca/NestedSort.js +0 -13
  151. data/app/assets/javascripts/gridx/nls/ca/PaginationBar.js +0 -30
  152. data/app/assets/javascripts/gridx/nls/ca/QuickFilter.js +0 -9
  153. data/app/assets/javascripts/gridx/nls/ca/SummaryBar.js +0 -7
  154. data/app/assets/javascripts/gridx/nls/cs/Body.js +0 -11
  155. data/app/assets/javascripts/gridx/nls/cs/NestedSort.js +0 -11
  156. data/app/assets/javascripts/gridx/nls/cs/PaginationBar.js +0 -34
  157. data/app/assets/javascripts/gridx/nls/cs/QuickFilter.js +0 -7
  158. data/app/assets/javascripts/gridx/nls/cs/SummaryBar.js +0 -5
  159. data/app/assets/javascripts/gridx/nls/da/Body.js +0 -11
  160. data/app/assets/javascripts/gridx/nls/da/NestedSort.js +0 -11
  161. data/app/assets/javascripts/gridx/nls/da/PaginationBar.js +0 -34
  162. data/app/assets/javascripts/gridx/nls/da/QuickFilter.js +0 -7
  163. data/app/assets/javascripts/gridx/nls/da/SummaryBar.js +0 -5
  164. data/app/assets/javascripts/gridx/nls/de/Body.js +0 -11
  165. data/app/assets/javascripts/gridx/nls/de/NestedSort.js +0 -11
  166. data/app/assets/javascripts/gridx/nls/de/PaginationBar.js +0 -34
  167. data/app/assets/javascripts/gridx/nls/de/QuickFilter.js +0 -7
  168. data/app/assets/javascripts/gridx/nls/de/SummaryBar.js +0 -5
  169. data/app/assets/javascripts/gridx/nls/el/Body.js +0 -11
  170. data/app/assets/javascripts/gridx/nls/el/NestedSort.js +0 -11
  171. data/app/assets/javascripts/gridx/nls/el/PaginationBar.js +0 -34
  172. data/app/assets/javascripts/gridx/nls/el/QuickFilter.js +0 -7
  173. data/app/assets/javascripts/gridx/nls/el/SummaryBar.js +0 -5
  174. data/app/assets/javascripts/gridx/nls/es/Body.js +0 -11
  175. data/app/assets/javascripts/gridx/nls/es/NestedSort.js +0 -13
  176. data/app/assets/javascripts/gridx/nls/es/PaginationBar.js +0 -30
  177. data/app/assets/javascripts/gridx/nls/es/QuickFilter.js +0 -9
  178. data/app/assets/javascripts/gridx/nls/es/SummaryBar.js +0 -7
  179. data/app/assets/javascripts/gridx/nls/fi/Body.js +0 -11
  180. data/app/assets/javascripts/gridx/nls/fi/NestedSort.js +0 -11
  181. data/app/assets/javascripts/gridx/nls/fi/PaginationBar.js +0 -34
  182. data/app/assets/javascripts/gridx/nls/fi/QuickFilter.js +0 -7
  183. data/app/assets/javascripts/gridx/nls/fi/SummaryBar.js +0 -5
  184. data/app/assets/javascripts/gridx/nls/fr/Body.js +0 -11
  185. data/app/assets/javascripts/gridx/nls/fr/NestedSort.js +0 -11
  186. data/app/assets/javascripts/gridx/nls/fr/PaginationBar.js +0 -34
  187. data/app/assets/javascripts/gridx/nls/fr/QuickFilter.js +0 -7
  188. data/app/assets/javascripts/gridx/nls/fr/SummaryBar.js +0 -5
  189. data/app/assets/javascripts/gridx/nls/he/Body.js +0 -11
  190. data/app/assets/javascripts/gridx/nls/he/NestedSort.js +0 -11
  191. data/app/assets/javascripts/gridx/nls/he/PaginationBar.js +0 -34
  192. data/app/assets/javascripts/gridx/nls/he/QuickFilter.js +0 -6
  193. data/app/assets/javascripts/gridx/nls/he/SummaryBar.js +0 -5
  194. data/app/assets/javascripts/gridx/nls/hr/Body.js +0 -11
  195. data/app/assets/javascripts/gridx/nls/hr/NestedSort.js +0 -11
  196. data/app/assets/javascripts/gridx/nls/hr/PaginationBar.js +0 -34
  197. data/app/assets/javascripts/gridx/nls/hr/QuickFilter.js +0 -7
  198. data/app/assets/javascripts/gridx/nls/hr/SummaryBar.js +0 -5
  199. data/app/assets/javascripts/gridx/nls/hu/Body.js +0 -11
  200. data/app/assets/javascripts/gridx/nls/hu/NestedSort.js +0 -11
  201. data/app/assets/javascripts/gridx/nls/hu/PaginationBar.js +0 -33
  202. data/app/assets/javascripts/gridx/nls/hu/QuickFilter.js +0 -7
  203. data/app/assets/javascripts/gridx/nls/hu/SummaryBar.js +0 -5
  204. data/app/assets/javascripts/gridx/nls/it/Body.js +0 -11
  205. data/app/assets/javascripts/gridx/nls/it/NestedSort.js +0 -11
  206. data/app/assets/javascripts/gridx/nls/it/PaginationBar.js +0 -34
  207. data/app/assets/javascripts/gridx/nls/it/QuickFilter.js +0 -7
  208. data/app/assets/javascripts/gridx/nls/it/SummaryBar.js +0 -5
  209. data/app/assets/javascripts/gridx/nls/ja/Body.js +0 -11
  210. data/app/assets/javascripts/gridx/nls/ja/NestedSort.js +0 -11
  211. data/app/assets/javascripts/gridx/nls/ja/PaginationBar.js +0 -34
  212. data/app/assets/javascripts/gridx/nls/ja/QuickFilter.js +0 -7
  213. data/app/assets/javascripts/gridx/nls/ja/SummaryBar.js +0 -5
  214. data/app/assets/javascripts/gridx/nls/kk/Body.js +0 -11
  215. data/app/assets/javascripts/gridx/nls/kk/NestedSort.js +0 -13
  216. data/app/assets/javascripts/gridx/nls/kk/PaginationBar.js +0 -30
  217. data/app/assets/javascripts/gridx/nls/kk/QuickFilter.js +0 -9
  218. data/app/assets/javascripts/gridx/nls/kk/SummaryBar.js +0 -7
  219. data/app/assets/javascripts/gridx/nls/ko/Body.js +0 -11
  220. data/app/assets/javascripts/gridx/nls/ko/NestedSort.js +0 -11
  221. data/app/assets/javascripts/gridx/nls/ko/PaginationBar.js +0 -34
  222. data/app/assets/javascripts/gridx/nls/ko/QuickFilter.js +0 -7
  223. data/app/assets/javascripts/gridx/nls/ko/SummaryBar.js +0 -5
  224. data/app/assets/javascripts/gridx/nls/nb/Body.js +0 -11
  225. data/app/assets/javascripts/gridx/nls/nb/NestedSort.js +0 -11
  226. data/app/assets/javascripts/gridx/nls/nb/PaginationBar.js +0 -34
  227. data/app/assets/javascripts/gridx/nls/nb/QuickFilter.js +0 -7
  228. data/app/assets/javascripts/gridx/nls/nb/SummaryBar.js +0 -5
  229. data/app/assets/javascripts/gridx/nls/nl/Body.js +0 -11
  230. data/app/assets/javascripts/gridx/nls/nl/NestedSort.js +0 -11
  231. data/app/assets/javascripts/gridx/nls/nl/PaginationBar.js +0 -34
  232. data/app/assets/javascripts/gridx/nls/nl/QuickFilter.js +0 -7
  233. data/app/assets/javascripts/gridx/nls/nl/SummaryBar.js +0 -5
  234. data/app/assets/javascripts/gridx/nls/pl/Body.js +0 -11
  235. data/app/assets/javascripts/gridx/nls/pl/NestedSort.js +0 -11
  236. data/app/assets/javascripts/gridx/nls/pl/PaginationBar.js +0 -34
  237. data/app/assets/javascripts/gridx/nls/pl/QuickFilter.js +0 -7
  238. data/app/assets/javascripts/gridx/nls/pl/SummaryBar.js +0 -5
  239. data/app/assets/javascripts/gridx/nls/pt/Body.js +0 -11
  240. data/app/assets/javascripts/gridx/nls/pt/NestedSort.js +0 -13
  241. data/app/assets/javascripts/gridx/nls/pt/PaginationBar.js +0 -30
  242. data/app/assets/javascripts/gridx/nls/pt/QuickFilter.js +0 -9
  243. data/app/assets/javascripts/gridx/nls/pt/SummaryBar.js +0 -7
  244. data/app/assets/javascripts/gridx/nls/pt-br/Body.js +0 -6
  245. data/app/assets/javascripts/gridx/nls/pt-br/FilterBar.js +0 -89
  246. data/app/assets/javascripts/gridx/nls/pt-br/NestedSort.js +0 -11
  247. data/app/assets/javascripts/gridx/nls/pt-br/PaginationBar.js +0 -34
  248. data/app/assets/javascripts/gridx/nls/pt-br/QuickFilter.js +0 -7
  249. data/app/assets/javascripts/gridx/nls/pt-br/SummaryBar.js +0 -5
  250. data/app/assets/javascripts/gridx/nls/pt-pt/Body.js +0 -11
  251. data/app/assets/javascripts/gridx/nls/pt-pt/NestedSort.js +0 -13
  252. data/app/assets/javascripts/gridx/nls/pt-pt/PaginationBar.js +0 -30
  253. data/app/assets/javascripts/gridx/nls/pt-pt/QuickFilter.js +0 -9
  254. data/app/assets/javascripts/gridx/nls/pt-pt/SummaryBar.js +0 -7
  255. data/app/assets/javascripts/gridx/nls/ro/Body.js +0 -11
  256. data/app/assets/javascripts/gridx/nls/ro/NestedSort.js +0 -13
  257. data/app/assets/javascripts/gridx/nls/ro/PaginationBar.js +0 -30
  258. data/app/assets/javascripts/gridx/nls/ro/QuickFilter.js +0 -9
  259. data/app/assets/javascripts/gridx/nls/ro/SummaryBar.js +0 -7
  260. data/app/assets/javascripts/gridx/nls/ru/Body.js +0 -11
  261. data/app/assets/javascripts/gridx/nls/ru/NestedSort.js +0 -11
  262. data/app/assets/javascripts/gridx/nls/ru/PaginationBar.js +0 -34
  263. data/app/assets/javascripts/gridx/nls/ru/QuickFilter.js +0 -7
  264. data/app/assets/javascripts/gridx/nls/ru/SummaryBar.js +0 -5
  265. data/app/assets/javascripts/gridx/nls/sk/Body.js +0 -11
  266. data/app/assets/javascripts/gridx/nls/sk/NestedSort.js +0 -13
  267. data/app/assets/javascripts/gridx/nls/sk/PaginationBar.js +0 -30
  268. data/app/assets/javascripts/gridx/nls/sk/QuickFilter.js +0 -9
  269. data/app/assets/javascripts/gridx/nls/sk/SummaryBar.js +0 -7
  270. data/app/assets/javascripts/gridx/nls/sl/Body.js +0 -11
  271. data/app/assets/javascripts/gridx/nls/sl/NestedSort.js +0 -11
  272. data/app/assets/javascripts/gridx/nls/sl/PaginationBar.js +0 -34
  273. data/app/assets/javascripts/gridx/nls/sl/QuickFilter.js +0 -7
  274. data/app/assets/javascripts/gridx/nls/sl/SummaryBar.js +0 -5
  275. data/app/assets/javascripts/gridx/nls/sv/Body.js +0 -11
  276. data/app/assets/javascripts/gridx/nls/sv/NestedSort.js +0 -11
  277. data/app/assets/javascripts/gridx/nls/sv/PaginationBar.js +0 -34
  278. data/app/assets/javascripts/gridx/nls/sv/QuickFilter.js +0 -7
  279. data/app/assets/javascripts/gridx/nls/sv/SummaryBar.js +0 -5
  280. data/app/assets/javascripts/gridx/nls/th/Body.js +0 -11
  281. data/app/assets/javascripts/gridx/nls/th/NestedSort.js +0 -11
  282. data/app/assets/javascripts/gridx/nls/th/PaginationBar.js +0 -34
  283. data/app/assets/javascripts/gridx/nls/th/QuickFilter.js +0 -7
  284. data/app/assets/javascripts/gridx/nls/th/SummaryBar.js +0 -5
  285. data/app/assets/javascripts/gridx/nls/tr/Body.js +0 -11
  286. data/app/assets/javascripts/gridx/nls/tr/NestedSort.js +0 -11
  287. data/app/assets/javascripts/gridx/nls/tr/PaginationBar.js +0 -34
  288. data/app/assets/javascripts/gridx/nls/tr/QuickFilter.js +0 -7
  289. data/app/assets/javascripts/gridx/nls/tr/SummaryBar.js +0 -5
  290. data/app/assets/javascripts/gridx/nls/uk/Body.js +0 -11
  291. data/app/assets/javascripts/gridx/nls/uk/NestedSort.js +0 -12
  292. data/app/assets/javascripts/gridx/nls/uk/PaginationBar.js +0 -28
  293. data/app/assets/javascripts/gridx/nls/uk/QuickFilter.js +0 -8
  294. data/app/assets/javascripts/gridx/nls/uk/SummaryBar.js +0 -6
  295. data/app/assets/javascripts/gridx/nls/zh/Body.js +0 -11
  296. data/app/assets/javascripts/gridx/nls/zh/NestedSort.js +0 -11
  297. data/app/assets/javascripts/gridx/nls/zh/PaginationBar.js +0 -34
  298. data/app/assets/javascripts/gridx/nls/zh/QuickFilter.js +0 -7
  299. data/app/assets/javascripts/gridx/nls/zh/SummaryBar.js +0 -5
  300. data/app/assets/javascripts/gridx/nls/zh-tw/Body.js +0 -11
  301. data/app/assets/javascripts/gridx/nls/zh-tw/NestedSort.js +0 -11
  302. data/app/assets/javascripts/gridx/nls/zh-tw/PaginationBar.js +0 -34
  303. data/app/assets/javascripts/gridx/nls/zh-tw/QuickFilter.js +0 -7
  304. data/app/assets/javascripts/gridx/nls/zh-tw/SummaryBar.js +0 -5
  305. data/app/assets/stylesheets/gridx/resources/Dod.css +0 -39
  306. data/app/assets/stylesheets/gridx/resources/Gridx_rtl.css +0 -5
  307. data/app/assets/stylesheets/gridx/resources/Tree.css +0 -46
  308. data/app/assets/stylesheets/gridx/resources/Tree_rtl.css +0 -4
  309. data/app/assets/stylesheets/gridx/resources/bar.css +0 -24
  310. data/app/assets/stylesheets/gridx/resources/basic.css +0 -482
  311. data/app/assets/stylesheets/gridx/resources/basic_rtl.css +0 -37
  312. data/app/assets/stylesheets/gridx/resources/claro/Gridx_rtl.css +0 -7
  313. data/app/assets/stylesheets/gridx/resources/claro/basic.css +0 -109
  314. data/app/assets/stylesheets/gridx/resources/claro/basic_rtl.css +0 -21
  315. data/app/assets/stylesheets/gridx/resources/claro/filter.css +0 -47
  316. data/app/assets/stylesheets/gridx/resources/claro/lock.css +0 -19
  317. data/app/assets/stylesheets/gridx/resources/claro/pagination.css +0 -33
  318. data/app/assets/stylesheets/gridx/resources/claro/select.css +0 -20
  319. data/app/assets/stylesheets/gridx/resources/dnd.css +0 -108
  320. data/app/assets/stylesheets/gridx/resources/filter.css +0 -321
  321. data/app/assets/stylesheets/gridx/resources/filter_rtl.css +0 -38
  322. data/app/assets/stylesheets/gridx/resources/lock.css +0 -20
  323. data/app/assets/stylesheets/gridx/resources/pagination.css +0 -142
  324. data/app/assets/stylesheets/gridx/resources/pagination_rtl.css +0 -54
  325. data/app/assets/stylesheets/gridx/resources/select.css +0 -39
  326. data/app/assets/stylesheets/gridx/resources/sort.css +0 -154
  327. data/app/assets/stylesheets/gridx/resources/sort_rtl.css +0 -51
@@ -1,17 +1,22 @@
1
1
  define([
2
- "dojo/_base/declare",
3
- "dojo/_base/lang",
4
- "dojo/_base/Deferred",
5
- "./_Cache"
6
- ], function(declare, lang, Deferred, _Cache){
2
+ 'dojo/_base/declare',
3
+ 'dojo/_base/array',
4
+ 'dojo/_base/lang',
5
+ 'dojo/_base/Deferred',
6
+ '../_Extension'
7
+ ], function(declare, array, lang, Deferred, _Extension){
7
8
 
8
9
  /*=====
9
- return declare(_Cache, {
10
+ return declare(_Extension, function(){
10
11
  // summary:
11
- // Implement a cache for client side store.
12
+ // Abstract base cache class, providing cache data structure and some common cache functions.
12
13
  });
13
14
  =====*/
14
15
 
16
+ var hitch = lang.hitch,
17
+ mixin = lang.mixin,
18
+ indexOf = array.indexOf;
19
+
15
20
  function fetchChildren(self){
16
21
  var s = self._struct,
17
22
  pids = s[''].slice(1),
@@ -27,9 +32,46 @@ define([
27
32
  }
28
33
  }
29
34
 
30
- return declare(_Cache, {
31
- keep: function(){},
32
- free: function(){},
35
+ return declare(_Extension, {
36
+ constructor: function(model, args){
37
+ var t = this;
38
+ t.setStore(args.store);
39
+ t.columns = lang.mixin({}, args.columnsById || args._columnsById);
40
+ t._mixinAPI('byIndex', 'byId', 'indexToId', 'idToIndex', 'size', 'treePath', 'rootId', 'parentId',
41
+ 'hasChildren', 'children', 'keep', 'free', 'layerId', 'setLayer', 'layerUp');
42
+ },
43
+
44
+ destroy: function(){
45
+ this.inherited(arguments);
46
+ this._layer = '';
47
+ this.clear();
48
+ },
49
+
50
+ setStore: function(store){
51
+ var t = this,
52
+ c = 'aspect',
53
+ old = store.fetch;
54
+ //Disconnect store events.
55
+ t.destroy();
56
+ t._cnnts = [];
57
+ t.store = store;
58
+ if(!old && store.notify){
59
+ //The store implements the dojo.store.Observable API
60
+ t[c](store, 'notify', function(item, id){
61
+ if(item === undefined){
62
+ t._onDelete(id);
63
+ }else if(id === undefined){
64
+ t._onNew(item);
65
+ }else{
66
+ t._onSet(item);
67
+ }
68
+ });
69
+ }else{
70
+ t[c](store, old ? "onSet" : "put", "_onSet");
71
+ t[c](store, old ? "onNew" : "add", "_onNew");
72
+ t[c](store, old ? "onDelete" : "remove", "_onDelete");
73
+ }
74
+ },
33
75
 
34
76
  when: function(args, callback){
35
77
  var d = new Deferred();
@@ -44,8 +86,138 @@ define([
44
86
  return d;
45
87
  },
46
88
 
47
- //Private---------------------------------------------
48
- _init: function(/*method, args*/){
89
+ //Public----------------------------------------------
90
+ clear: function(){
91
+ var t = this;
92
+ t._filled = 0;
93
+ t._priority = [];
94
+ t._struct = {};
95
+ t._cache = {};
96
+ t._size = {};
97
+ //virtual root node, with id ''.
98
+ t._struct[''] = [];
99
+ t._size[''] = -1;
100
+ t.totalSize = undefined;
101
+ },
102
+
103
+ layerId: function(){
104
+ return this._layer;
105
+ },
106
+
107
+ setLayer: function(id){
108
+ this._layer = id;
109
+ this.model._msg('storeChange');
110
+ this.model._onSizeChange();
111
+ },
112
+
113
+ layerUp: function(){
114
+ var pid = this.parentId(this._layer);
115
+ this.setLayer(pid);
116
+ },
117
+
118
+ byIndex: function(index, parentId){
119
+ this._init();
120
+ return this._cache[this.indexToId(index, parentId)];
121
+ },
122
+
123
+ byId: function(id){
124
+ this._init();
125
+ return this._cache[id];
126
+ },
127
+
128
+ indexToId: function(index, parentId){
129
+ this._init();
130
+ var items = this._struct[this.model.isId(parentId) ? parentId : this.layerId()];
131
+ return typeof index == 'number' && index >= 0 ? items && items[index + 1] : undefined;
132
+ },
133
+
134
+ idToIndex: function(id){
135
+ this._init();
136
+ var s = this._struct,
137
+ pid = s[id] && s[id][0],
138
+ index = indexOf(s[pid] || [], id);
139
+ return index > 0 ? index - 1 : -1;
140
+ },
141
+
142
+ treePath: function(id){
143
+ this._init();
144
+ var s = this._struct,
145
+ path = [];
146
+ while(id !== undefined){
147
+ path.unshift(id);
148
+ id = s[id] && s[id][0];
149
+ }
150
+ if(path[0] !== ''){
151
+ path = [];
152
+ }else{
153
+ path.pop();
154
+ }
155
+ return path;
156
+ },
157
+
158
+ rootId: function(id){
159
+ var path = this.treePath(id);
160
+ if(path.length > 1){
161
+ return path[1];
162
+ }else if(!path.length){
163
+ return null;
164
+ }
165
+ return id;
166
+ },
167
+
168
+ parentId: function(id){
169
+ return this.treePath(id).pop();
170
+ },
171
+
172
+ hasChildren: function(id){
173
+ var t = this,
174
+ s = t.store,
175
+ c;
176
+ t._init();
177
+ c = t.byId(id);
178
+ return s.hasChildren && s.hasChildren(id, c && c.item) && s.getChildren;
179
+ },
180
+
181
+ children: function(parentId){
182
+ this._init();
183
+ parentId = this.model.isId(parentId) ? parentId : '';
184
+ var size = this._size[parentId],
185
+ children = [],
186
+ i = 0;
187
+ for(; i < size; ++i){
188
+ children.push(this.indexToId(i, parentId));
189
+ }
190
+ return children;
191
+ },
192
+
193
+ size: function(parentId){
194
+ this._init();
195
+ var s = this._size[this.model.isId(parentId) ? parentId : this.layerId()];
196
+ return s >= 0 ? s : -1;
197
+ },
198
+
199
+ keep: function(){},
200
+ free: function(){},
201
+
202
+ //Events--------------------------------------------
203
+ onBeforeFetch: function(){},
204
+ onAfterFetch: function(){},
205
+ onLoadRow: function(){},
206
+
207
+ onSetColumns: function(columns){
208
+ var t = this, id, c, colId, col;
209
+ t.columns = lang.mixin({}, columns);
210
+ for(id in t._cache){
211
+ c = t._cache[id];
212
+ for(colId in columns){
213
+ col = columns[colId];
214
+ c.data[colId] = t._formatCell(c.rawData, id, col.id);
215
+ }
216
+ }
217
+ },
218
+
219
+ //Protected-----------------------------------------
220
+ _init: function(){
49
221
  var t = this;
50
222
  if(!t._filled){
51
223
  t._storeFetch({ start: 0 });
@@ -54,6 +226,236 @@ define([
54
226
  }
55
227
  t.model._onSizeChange();
56
228
  }
229
+ },
230
+
231
+ _itemToObject: function(item){
232
+ var s = this.store,
233
+ obj = {};
234
+ if(s.fetch){
235
+ array.forEach(s.getAttributes(item), function(attr){
236
+ obj[attr] = s.getValue(item, attr);
237
+ });
238
+ return obj;
239
+ }
240
+ return item;
241
+ },
242
+
243
+ _formatCell: function(rawData, rowId, colId){
244
+ var col = this.columns[colId];
245
+ return col.formatter ? col.formatter(rawData, rowId) : rawData[col.field || colId];
246
+ },
247
+
248
+ _formatRow: function(rowData, rowId){
249
+ var cols = this.columns, res = {}, colId;
250
+ for(colId in cols){
251
+ res[colId] = this._formatCell(rowData, rowId, colId);
252
+ }
253
+ return res;
254
+ },
255
+
256
+ _addRow: function(id, index, rowData, item, parentId){
257
+ var t = this,
258
+ st = t._struct,
259
+ pr = t._priority,
260
+ pid = t.model.isId(parentId) ? parentId : '',
261
+ ids = st[pid],
262
+ i;
263
+ if(!ids){
264
+ throw new Error("Fatal error of _Cache._addRow: parent item " + pid + " of " + id + " is not loaded");
265
+ }
266
+ var oldId = ids[index + 1];
267
+ if(t.model.isId(oldId) && oldId !== id){
268
+ console.error("Error of _Cache._addRow: different row id " + id + " and " + ids[index + 1] + " for same row index " + index);
269
+ }
270
+ ids[index + 1] = id;
271
+ st[id] = st[id] || [pid];
272
+ if(pid === ''){
273
+ i = indexOf(pr, id);
274
+ if(i >= 0){
275
+ pr.splice(i, 1);
276
+ }
277
+ pr.push(id);
278
+ }
279
+ t._cache[id] = {
280
+ data: t._formatRow(rowData, id),
281
+ rawData: rowData,
282
+ item: item
283
+ };
284
+ t.onLoadRow(id);
285
+ },
286
+
287
+ _storeFetch: function(options, onFetched){
288
+ // console.debug("\tFETCH parent: ",
289
+ // options.parentId, ", start: ",
290
+ // options.start || 0, ", count: ",
291
+ // options.count, ", end: ",
292
+ // options.count && (options.start || 0) + options.count - 1, ", options:",
293
+ // this.options);
294
+
295
+ var t = this,
296
+ s = t.store,
297
+ d = new Deferred(),
298
+ parentId = t.model.isId(options.parentId) ? options.parentId : '',
299
+ req = mixin({}, t.options || {}, options),
300
+ onError = hitch(d, d.errback),
301
+ results;
302
+ function onBegin(size){
303
+ t._size[parentId] = parseInt(size, 10);
304
+ }
305
+ function onComplete(items){
306
+ //FIXME: store does not support getting total size after filter/query, so we must change the protocal a little.
307
+ if(items.ioArgs && items.ioArgs.xhr){
308
+ var range = results.ioArgs.xhr.getResponseHeader("Content-Range");
309
+ if(range && (range = range.match(/(.+)\//))){
310
+ t.totalSize = +range[1];
311
+ }else{
312
+ t.totalSize = undefined;
313
+ }
314
+ }
315
+ try{
316
+ var start = options.start || 0,
317
+ i = 0,
318
+ item;
319
+ for(; item = items[i]; ++i){
320
+ t._addRow(s.getIdentity(item), start + i, t._itemToObject(item), item, parentId);
321
+ }
322
+ d.callback();
323
+ }catch(e){
324
+ d.errback(e);
325
+ }
326
+ }
327
+ t._filled = 1;
328
+ t.onBeforeFetch(req);
329
+ if(parentId === ''){
330
+ if(s.fetch){
331
+ s.fetch(mixin(req, {
332
+ onBegin: onBegin,
333
+ onComplete: onComplete,
334
+ onError: onError
335
+ }));
336
+ }else{
337
+ results = s.query(req.query || {}, req);
338
+ Deferred.when(results.total, onBegin);
339
+ Deferred.when(results, onComplete, onError);
340
+ }
341
+ }else if(t.hasChildren(parentId)){
342
+ results = s.getChildren(t.byId(parentId).item, req);
343
+ if('total' in results){
344
+ Deferred.when(results.total, onBegin);
345
+ }else{
346
+ Deferred.when(results, function(results){
347
+ onBegin(results.length);
348
+ });
349
+ }
350
+ Deferred.when(results, onComplete, onError);
351
+ }else{
352
+ d.callback();
353
+ }
354
+ d.then(function(){
355
+ t.onAfterFetch();
356
+ });
357
+ return d;
358
+ },
359
+
360
+ //--------------------------------------------------------------------------
361
+ _onSet: function(item){
362
+ var t = this,
363
+ id = t.store.getIdentity(item),
364
+ index = t.idToIndex(id),
365
+ path = t.treePath(id),
366
+ old = t._cache[id];
367
+ if(path.length){
368
+ t._addRow(id, index, t._itemToObject(item), item, path.pop());
369
+ }
370
+ t.onSet(id, index, t._cache[id], old);
371
+ },
372
+
373
+ _onNew: function(item, parentInfo){
374
+ var t = this,
375
+ s = t.store,
376
+ row = t._itemToObject(item),
377
+ parentItem = parentInfo && parentInfo[s.fetch ? 'item' : 'parent'],
378
+ parentId = parentItem ? s.getIdentity(parentItem) : '',
379
+ id = s.getIdentity(item),
380
+ size = t._size[''];
381
+ t.clear();
382
+ t.onNew(id, 0, {
383
+ data: t._formatRow(row, id),
384
+ rawData: row,
385
+ item: item
386
+ });
387
+ if(!parentItem && size >= 0){
388
+ t._size[''] = size + 1;
389
+ if(t.totalSize >= 0){
390
+ t.totalSize = size + 1;
391
+ }
392
+ t.model._onSizeChange();
393
+ }
394
+ },
395
+
396
+ _onDelete: function(item){
397
+ var t = this,
398
+ s = t.store,
399
+ st = t._struct,
400
+ id = s.fetch ? s.getIdentity(item) : item,
401
+ path = t.treePath(id);
402
+ if(path.length){
403
+ var children, i, j,
404
+ ids = [id],
405
+ parentId = path[path.length - 1],
406
+ sz = t._size,
407
+ size = sz[''],
408
+ index = indexOf(st[parentId], id);
409
+ //This must exist, because we've already have treePath
410
+ st[parentId].splice(index, 1);
411
+ --sz[parentId];
412
+
413
+ for(i = 0; i < ids.length; ++i){
414
+ children = st[ids[i]];
415
+ if(children){
416
+ for(j = children.length - 1; j > 0; --j){
417
+ ids.push(children[j]);
418
+ }
419
+ }
420
+ }
421
+ for(i = ids.length - 1; i >= 0; --i){
422
+ j = ids[i];
423
+ delete t._cache[j];
424
+ delete st[j];
425
+ delete sz[j];
426
+ }
427
+ i = indexOf(t._priority, id);
428
+ if(i >= 0){
429
+ t._priority.splice(i, 1);
430
+ }
431
+ t.onDelete(id, index - 1, path);
432
+ if(!parentId && size >= 0){
433
+ sz[''] = size - 1;
434
+ if(t.totalSize >= 0){
435
+ t.totalSize = size - 1;
436
+ }
437
+ t.model._onSizeChange();
438
+ }
439
+ }else{
440
+ //FIXME: Don't know what to do if the deleted row was not loaded.
441
+ t.clear();
442
+ t.onDelete(id);
443
+ // var onBegin = hitch(t, _onBegin),
444
+ // req = mixin({}, t.options || {}, {
445
+ // start: 0,
446
+ // count: 1
447
+ // });
448
+ // setTimeout(function(){
449
+ // if(s.fetch){
450
+ // s.fetch(mixin(req, {
451
+ // onBegin: onBegin
452
+ // }));
453
+ // }else{
454
+ // var results = s.query(req.query, req);
455
+ // Deferred.when(results.total, onBegin);
456
+ // }
457
+ // }, 10);
458
+ }
57
459
  }
58
460
  });
59
461
  });
@@ -276,7 +276,6 @@ define([
276
276
  if(!toMark){
277
277
  delete t._byId[type][id];
278
278
  }
279
- //console.log('mark change: ', id, ', state: ', oldState, ' => ', toMark);
280
279
  m.onMarkChange(id, t.states[toMark || 0], t.states[oldState || 0], type);
281
280
  }
282
281
  },
@@ -289,26 +288,23 @@ define([
289
288
  for(var i = treePath.length - 1; i > 0; --i){
290
289
  var pid = treePath[i],
291
290
  oldState = byId[pid],
292
- siblings = array.filter(mm._call('children', [pid]), function(childId){
293
- return t._isMarkable(type, childId);
294
- }),
291
+ siblings = mm._call('children', [pid]),
295
292
  markCount = array.filter(siblings, function(childId){
296
293
  return last[childId] = byId[childId];
297
294
  }).length,
298
295
  fullCount = array.filter(siblings, function(childId){
299
296
  return byId[childId] == 2;
300
297
  }).length;
301
- if(t._isMarkable(type, pid)){
302
- if(fullCount != 0 && fullCount == siblings.length && oldState != 2){
303
- byId[pid] = 2; //none|partial -> all
304
- }else if(!markCount && oldState){
305
- delete byId[pid]; //all|partial -> none
306
- }else if(markCount && fullCount < siblings.length && oldState != 1){
307
- byId[pid] = 1; //all|none -> partial
308
- }
309
- if(!noEvent){
310
- t._fireEvent(pid, type, byId[pid], oldState);
311
- }
298
+ // if(t._isMarkable(type, pid)){
299
+ if(fullCount != 0 && fullCount == siblings.length && oldState != 2){
300
+ byId[pid] = 2; //none|partial -> all
301
+ }else if(!markCount && oldState){
302
+ delete byId[pid]; //all|partial -> none
303
+ }else if(markCount && fullCount < siblings.length && oldState != 1){
304
+ byId[pid] = 1; //all|none -> partial
305
+ }
306
+ if(!noEvent){
307
+ t._fireEvent(pid, type, byId[pid], oldState);
312
308
  }
313
309
  }
314
310
  },
@@ -341,11 +337,9 @@ define([
341
337
  while(ids.length){
342
338
  childId = ids.shift();
343
339
  oldState = byId[childId] || 0;
344
- if(t._isMarkable(tp, childId)){
345
- newState = byId[childId] = toMark == 1 ? last[childId] || 0 : toMark;
346
- if(!noEvent){
347
- t._fireEvent(childId, tp, newState, oldState);
348
- }
340
+ newState = byId[childId] = toMark == 1 ? last[childId] || 0 : toMark;
341
+ if(!noEvent){
342
+ t._fireEvent(childId, tp, newState, oldState);
349
343
  }
350
344
  if(mm._call('hasChildren', [childId])){
351
345
  children = mm._call('children', [childId]);
@@ -140,11 +140,7 @@ define([
140
140
  byId: function(id){
141
141
  var t = this,
142
142
  c = t.inner._call('byId', arguments);
143
-
144
- if(!c || !t._lazyRawData[id]){
145
- return c;
146
- }
147
-
143
+ if(!c){ return c; }
148
144
  var d = lang.mixin({}, c);
149
145
  d.rawData = lang.mixin({}, d.rawData, t._lazyRawData[id]);
150
146
  d.data = lang.mixin({}, d.data, t._lazyData[id]);
@@ -155,12 +151,9 @@ define([
155
151
  var t = this,
156
152
  c = t.inner._call('byIndex', arguments),
157
153
  id = t.inner._call('indexToId', arguments);
158
-
159
- if(!c || !t._lazyRawData[id]){
160
- return c;
161
- }
162
-
154
+ if(!c){ return c; }
163
155
  var d = lang.mixin({}, c);
156
+
164
157
  d.rawData = lang.mixin({}, d.rawData, t._lazyRawData[id]);
165
158
  d.data = lang.mixin({}, d.data, t._lazyData[id]);
166
159
  return d;
@@ -0,0 +1,100 @@
1
+ define([
2
+ "dojo/_base/declare",
3
+ "dojo/_base/lang",
4
+ "dojo/dom-class",
5
+ "dojo/_base/Deferred",
6
+ "./Body",
7
+ "./_PagedBodyMixin"
8
+ ], function(declare, lang, domClass, Deferred, Body, _PagedBodyMixin){
9
+
10
+ /*=====
11
+ return declare(Body, {
12
+ // summary:
13
+ // module name: body.
14
+ //
15
+ // description:
16
+ //
17
+ });
18
+ =====*/
19
+
20
+ return declare([Body, _PagedBodyMixin], {
21
+ preload: function(){
22
+ this.inherited(arguments);
23
+ var t = this,
24
+ g = t.grid,
25
+ dn = t.domNode,
26
+ load = function(){
27
+ t._load(1);
28
+ };
29
+ t.connect(dn, 'onscroll', function(e){
30
+ var lastNode = dn.lastChild;
31
+ if(lastNode.offsetTop + lastNode.offsetHeight <= dn.scrollTop + dn.offsetHeight){
32
+ clearTimeout(t._loadHandler);
33
+ t._loadHandler = setTimeout(load, 10);
34
+ }
35
+ });
36
+ t.aspect(g, '_onResizeEnd', function(){
37
+ if(t._checkSpace()){
38
+ t._load(1);
39
+ }
40
+ });
41
+ g.vScroller.loaded.then(function(){
42
+ var scrollable = g.vScroller._scrollable;
43
+ if(scrollable){
44
+ t.aspect(scrollable, 'slideTo', function(to, duration){
45
+ if(to.y < g.mainNode.offsetHeight - g.bodyNode.offsetHeight + dn.lastChild.offsetHeight){
46
+ clearTimeout(t._loadHandler);
47
+ t._loadHandler = setTimeout(load, duration * 1000);
48
+ }
49
+ });
50
+ }
51
+ });
52
+ },
53
+
54
+ _checkSpace: function(){
55
+ var bn = this.domNode;
56
+ return bn.lastChild == this._bottomNode && bn.lastChild.offsetTop + bn.lastChild.offsetHeight < bn.scrollTop + bn.offsetHeight;
57
+ },
58
+
59
+ onRender: function(/*start, count*/){
60
+ var t = this;
61
+ t.inherited(arguments);
62
+ if(t._checkSpace()){
63
+ t._load(1);
64
+ }
65
+ },
66
+
67
+ createBottom: function(bottomNode){
68
+ bottomNode.innerHTML = '<span class="gridxLoadingMore"></span>' + this.arg('loadMoreLoadingLabel', this.grid.nls.loadMoreLoading);
69
+ },
70
+
71
+ refresh: function(){
72
+ var inherited = lang.hitch(this, this.inherited, arguments);
73
+ if(this.arg('quickRefresh')){
74
+ domClass.add(this.grid.loadingNode, 'gridxLoading');
75
+ var scrollable = this.grid.vScroller._scrollable;
76
+ if(scrollable){
77
+ var pos = scrollable.getPos();
78
+ scrollable.scrollTo({x: pos.x, y: 0});
79
+ }
80
+ var d = new Deferred();
81
+ this.grid.view.updateRootRange(0, this.pageSize).then(function(){
82
+ inherited().then(function(){
83
+ d.callback();
84
+ }, function(e){
85
+ d.errback(e);
86
+ });
87
+ });
88
+ return d;
89
+ }else{
90
+ return inherited();
91
+ }
92
+ },
93
+
94
+ _busy: function(){},
95
+
96
+ _onLoadFinish: function(isPost, start, count, callback){
97
+ callback();
98
+ }
99
+ });
100
+ });