gridx-rails 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (518) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE +2 -0
  3. data/README.md +18 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/images/gridx/mobile/themes/iphone/images/ajax-loader.gif +0 -0
  6. data/app/assets/images/gridx/mobile/themes/iphone/images/arrow.png +0 -0
  7. data/app/assets/images/gridx/resources/images/checkboxpartial.png +0 -0
  8. data/app/assets/images/gridx/resources/images/checkboxpartialdisabled.png +0 -0
  9. data/app/assets/images/gridx/resources/images/claro-grid-header-onepixel.bmp +0 -0
  10. data/app/assets/images/gridx/resources/images/dndCopy.png +0 -0
  11. data/app/assets/images/gridx/resources/images/dndMove.png +0 -0
  12. data/app/assets/images/gridx/resources/images/dndNoCopy.png +0 -0
  13. data/app/assets/images/gridx/resources/images/dndNoMove.png +0 -0
  14. data/app/assets/images/gridx/resources/images/gridxCellChanged.png +0 -0
  15. data/app/assets/images/gridx/resources/images/header.png +0 -0
  16. data/app/assets/images/gridx/resources/images/header_shadow.png +0 -0
  17. data/app/assets/images/gridx/resources/images/loadingAnimation.gif +0 -0
  18. data/app/assets/images/gridx/resources/images/row_back.png +0 -0
  19. data/app/assets/images/gridx/resources/images/row_back_changed.png +0 -0
  20. data/app/assets/images/gridx/resources/images/sprite_icons.png +0 -0
  21. data/app/assets/images/gridx/resources/images/treeExpandImages.png +0 -0
  22. data/app/assets/images/gridx/resources/images/treeExpand_loading.gif +0 -0
  23. data/app/assets/javascripts/gridx/Grid.js +224 -0
  24. data/app/assets/javascripts/gridx/GridCommon.js +52 -0
  25. data/app/assets/javascripts/gridx/allModules.js +105 -0
  26. data/app/assets/javascripts/gridx/core/Cell.js +86 -0
  27. data/app/assets/javascripts/gridx/core/Column.js +183 -0
  28. data/app/assets/javascripts/gridx/core/Core.js +447 -0
  29. data/app/assets/javascripts/gridx/core/Row.js +174 -0
  30. data/app/assets/javascripts/gridx/core/_Module.js +285 -0
  31. data/app/assets/javascripts/gridx/core/model/Model.js +495 -0
  32. data/app/assets/javascripts/gridx/core/model/_Extension.js +84 -0
  33. data/app/assets/javascripts/gridx/core/model/cache/Async.js +469 -0
  34. data/app/assets/javascripts/gridx/core/model/cache/Sync.js +59 -0
  35. data/app/assets/javascripts/gridx/core/model/cache/_Cache.js +386 -0
  36. data/app/assets/javascripts/gridx/core/model/extensions/ClientFilter.js +303 -0
  37. data/app/assets/javascripts/gridx/core/model/extensions/FormatSort.js +103 -0
  38. data/app/assets/javascripts/gridx/core/model/extensions/Mark.js +370 -0
  39. data/app/assets/javascripts/gridx/core/model/extensions/Modify.js +418 -0
  40. data/app/assets/javascripts/gridx/core/model/extensions/Move.js +429 -0
  41. data/app/assets/javascripts/gridx/core/model/extensions/Query.js +50 -0
  42. data/app/assets/javascripts/gridx/core/model/extensions/Sort.js +81 -0
  43. data/app/assets/javascripts/gridx/core/util.js +13 -0
  44. data/app/assets/javascripts/gridx/mobile/Grid.js +300 -0
  45. data/app/assets/javascripts/gridx/mobile/LazyLoad.js +88 -0
  46. data/app/assets/javascripts/gridx/mobile/PullRefresh.js +117 -0
  47. data/app/assets/javascripts/gridx/mobile/Sort.js +66 -0
  48. data/app/assets/javascripts/gridx/mobile/nls/LazyLoad.js +38 -0
  49. data/app/assets/javascripts/gridx/mobile/nls/PullRefresh.js +39 -0
  50. data/app/assets/javascripts/gridx/mobile/nls/ar/LazyLoad.js +6 -0
  51. data/app/assets/javascripts/gridx/mobile/nls/ar/PullRefresh.js +7 -0
  52. data/app/assets/javascripts/gridx/mobile/nls/ar/common.js +5 -0
  53. data/app/assets/javascripts/gridx/mobile/nls/bg/LazyLoad.js +6 -0
  54. data/app/assets/javascripts/gridx/mobile/nls/bg/PullRefresh.js +7 -0
  55. data/app/assets/javascripts/gridx/mobile/nls/bg/common.js +5 -0
  56. data/app/assets/javascripts/gridx/mobile/nls/ca/LazyLoad.js +6 -0
  57. data/app/assets/javascripts/gridx/mobile/nls/ca/PullRefresh.js +7 -0
  58. data/app/assets/javascripts/gridx/mobile/nls/ca/common.js +5 -0
  59. data/app/assets/javascripts/gridx/mobile/nls/common.js +37 -0
  60. data/app/assets/javascripts/gridx/mobile/nls/cs/LazyLoad.js +6 -0
  61. data/app/assets/javascripts/gridx/mobile/nls/cs/PullRefresh.js +7 -0
  62. data/app/assets/javascripts/gridx/mobile/nls/cs/common.js +5 -0
  63. data/app/assets/javascripts/gridx/mobile/nls/da/LazyLoad.js +6 -0
  64. data/app/assets/javascripts/gridx/mobile/nls/da/PullRefresh.js +7 -0
  65. data/app/assets/javascripts/gridx/mobile/nls/da/common.js +5 -0
  66. data/app/assets/javascripts/gridx/mobile/nls/de/LazyLoad.js +6 -0
  67. data/app/assets/javascripts/gridx/mobile/nls/de/PullRefresh.js +7 -0
  68. data/app/assets/javascripts/gridx/mobile/nls/de/common.js +5 -0
  69. data/app/assets/javascripts/gridx/mobile/nls/el/LazyLoad.js +6 -0
  70. data/app/assets/javascripts/gridx/mobile/nls/el/PullRefresh.js +7 -0
  71. data/app/assets/javascripts/gridx/mobile/nls/el/common.js +5 -0
  72. data/app/assets/javascripts/gridx/mobile/nls/es/LazyLoad.js +6 -0
  73. data/app/assets/javascripts/gridx/mobile/nls/es/PullRefresh.js +7 -0
  74. data/app/assets/javascripts/gridx/mobile/nls/es/common.js +5 -0
  75. data/app/assets/javascripts/gridx/mobile/nls/fi/LazyLoad.js +6 -0
  76. data/app/assets/javascripts/gridx/mobile/nls/fi/PullRefresh.js +7 -0
  77. data/app/assets/javascripts/gridx/mobile/nls/fi/common.js +5 -0
  78. data/app/assets/javascripts/gridx/mobile/nls/fr/LazyLoad.js +6 -0
  79. data/app/assets/javascripts/gridx/mobile/nls/fr/PullRefresh.js +7 -0
  80. data/app/assets/javascripts/gridx/mobile/nls/fr/common.js +5 -0
  81. data/app/assets/javascripts/gridx/mobile/nls/he/LazyLoad.js +6 -0
  82. data/app/assets/javascripts/gridx/mobile/nls/he/PullRefresh.js +7 -0
  83. data/app/assets/javascripts/gridx/mobile/nls/he/common.js +5 -0
  84. data/app/assets/javascripts/gridx/mobile/nls/hr/LazyLoad.js +6 -0
  85. data/app/assets/javascripts/gridx/mobile/nls/hr/PullRefresh.js +7 -0
  86. data/app/assets/javascripts/gridx/mobile/nls/hr/common.js +5 -0
  87. data/app/assets/javascripts/gridx/mobile/nls/hu/LazyLoad.js +6 -0
  88. data/app/assets/javascripts/gridx/mobile/nls/hu/PullRefresh.js +7 -0
  89. data/app/assets/javascripts/gridx/mobile/nls/hu/common.js +5 -0
  90. data/app/assets/javascripts/gridx/mobile/nls/it/LazyLoad.js +6 -0
  91. data/app/assets/javascripts/gridx/mobile/nls/it/PullRefresh.js +7 -0
  92. data/app/assets/javascripts/gridx/mobile/nls/it/common.js +5 -0
  93. data/app/assets/javascripts/gridx/mobile/nls/ja/LazyLoad.js +6 -0
  94. data/app/assets/javascripts/gridx/mobile/nls/ja/PullRefresh.js +7 -0
  95. data/app/assets/javascripts/gridx/mobile/nls/ja/common.js +5 -0
  96. data/app/assets/javascripts/gridx/mobile/nls/kk/LazyLoad.js +6 -0
  97. data/app/assets/javascripts/gridx/mobile/nls/kk/PullRefresh.js +7 -0
  98. data/app/assets/javascripts/gridx/mobile/nls/kk/common.js +5 -0
  99. data/app/assets/javascripts/gridx/mobile/nls/ko/LazyLoad.js +6 -0
  100. data/app/assets/javascripts/gridx/mobile/nls/ko/PullRefresh.js +7 -0
  101. data/app/assets/javascripts/gridx/mobile/nls/ko/common.js +5 -0
  102. data/app/assets/javascripts/gridx/mobile/nls/nb/LazyLoad.js +6 -0
  103. data/app/assets/javascripts/gridx/mobile/nls/nb/PullRefresh.js +7 -0
  104. data/app/assets/javascripts/gridx/mobile/nls/nb/common.js +5 -0
  105. data/app/assets/javascripts/gridx/mobile/nls/nl/LazyLoad.js +6 -0
  106. data/app/assets/javascripts/gridx/mobile/nls/nl/PullRefresh.js +7 -0
  107. data/app/assets/javascripts/gridx/mobile/nls/nl/common.js +5 -0
  108. data/app/assets/javascripts/gridx/mobile/nls/pl/LazyLoad.js +6 -0
  109. data/app/assets/javascripts/gridx/mobile/nls/pl/PullRefresh.js +7 -0
  110. data/app/assets/javascripts/gridx/mobile/nls/pl/common.js +5 -0
  111. data/app/assets/javascripts/gridx/mobile/nls/pt/LazyLoad.js +6 -0
  112. data/app/assets/javascripts/gridx/mobile/nls/pt/PullRefresh.js +7 -0
  113. data/app/assets/javascripts/gridx/mobile/nls/pt/common.js +5 -0
  114. data/app/assets/javascripts/gridx/mobile/nls/pt-pt/LazyLoad.js +6 -0
  115. data/app/assets/javascripts/gridx/mobile/nls/pt-pt/PullRefresh.js +7 -0
  116. data/app/assets/javascripts/gridx/mobile/nls/pt-pt/common.js +5 -0
  117. data/app/assets/javascripts/gridx/mobile/nls/ro/LazyLoad.js +6 -0
  118. data/app/assets/javascripts/gridx/mobile/nls/ro/PullRefresh.js +7 -0
  119. data/app/assets/javascripts/gridx/mobile/nls/ro/common.js +5 -0
  120. data/app/assets/javascripts/gridx/mobile/nls/ru/LazyLoad.js +6 -0
  121. data/app/assets/javascripts/gridx/mobile/nls/ru/PullRefresh.js +7 -0
  122. data/app/assets/javascripts/gridx/mobile/nls/ru/common.js +5 -0
  123. data/app/assets/javascripts/gridx/mobile/nls/sk/LazyLoad.js +6 -0
  124. data/app/assets/javascripts/gridx/mobile/nls/sk/PullRefresh.js +7 -0
  125. data/app/assets/javascripts/gridx/mobile/nls/sk/common.js +5 -0
  126. data/app/assets/javascripts/gridx/mobile/nls/sl/LazyLoad.js +6 -0
  127. data/app/assets/javascripts/gridx/mobile/nls/sl/PullRefresh.js +7 -0
  128. data/app/assets/javascripts/gridx/mobile/nls/sl/common.js +5 -0
  129. data/app/assets/javascripts/gridx/mobile/nls/sv/LazyLoad.js +6 -0
  130. data/app/assets/javascripts/gridx/mobile/nls/sv/PullRefresh.js +7 -0
  131. data/app/assets/javascripts/gridx/mobile/nls/sv/common.js +5 -0
  132. data/app/assets/javascripts/gridx/mobile/nls/th/LazyLoad.js +6 -0
  133. data/app/assets/javascripts/gridx/mobile/nls/th/PullRefresh.js +7 -0
  134. data/app/assets/javascripts/gridx/mobile/nls/th/common.js +5 -0
  135. data/app/assets/javascripts/gridx/mobile/nls/tr/LazyLoad.js +6 -0
  136. data/app/assets/javascripts/gridx/mobile/nls/tr/PullRefresh.js +7 -0
  137. data/app/assets/javascripts/gridx/mobile/nls/tr/common.js +5 -0
  138. data/app/assets/javascripts/gridx/mobile/nls/uk/LazyLoad.js +6 -0
  139. data/app/assets/javascripts/gridx/mobile/nls/uk/PullRefresh.js +7 -0
  140. data/app/assets/javascripts/gridx/mobile/nls/uk/common.js +5 -0
  141. data/app/assets/javascripts/gridx/mobile/nls/zh/LazyLoad.js +6 -0
  142. data/app/assets/javascripts/gridx/mobile/nls/zh/PullRefresh.js +7 -0
  143. data/app/assets/javascripts/gridx/mobile/nls/zh/common.js +5 -0
  144. data/app/assets/javascripts/gridx/mobile/nls/zh-tw/LazyLoad.js +6 -0
  145. data/app/assets/javascripts/gridx/mobile/nls/zh-tw/PullRefresh.js +7 -0
  146. data/app/assets/javascripts/gridx/mobile/nls/zh-tw/common.js +5 -0
  147. data/app/assets/javascripts/gridx/modules/AutoScroll.js +100 -0
  148. data/app/assets/javascripts/gridx/modules/Bar.js +322 -0
  149. data/app/assets/javascripts/gridx/modules/Body.js +1059 -0
  150. data/app/assets/javascripts/gridx/modules/CellWidget.js +538 -0
  151. data/app/assets/javascripts/gridx/modules/ColumnLock.js +254 -0
  152. data/app/assets/javascripts/gridx/modules/ColumnResizer.js +278 -0
  153. data/app/assets/javascripts/gridx/modules/ColumnWidth.js +320 -0
  154. data/app/assets/javascripts/gridx/modules/Dod.js +368 -0
  155. data/app/assets/javascripts/gridx/modules/Edit.js +1024 -0
  156. data/app/assets/javascripts/gridx/modules/Filter.js +482 -0
  157. data/app/assets/javascripts/gridx/modules/Focus.js +439 -0
  158. data/app/assets/javascripts/gridx/modules/GroupHeader.js +437 -0
  159. data/app/assets/javascripts/gridx/modules/HLayout.js +139 -0
  160. data/app/assets/javascripts/gridx/modules/HScroller.js +172 -0
  161. data/app/assets/javascripts/gridx/modules/Header.js +289 -0
  162. data/app/assets/javascripts/gridx/modules/HeaderMenu.js +63 -0
  163. data/app/assets/javascripts/gridx/modules/HeaderRegions.js +201 -0
  164. data/app/assets/javascripts/gridx/modules/HiddenColumns.js +274 -0
  165. data/app/assets/javascripts/gridx/modules/IndirectSelect.js +287 -0
  166. data/app/assets/javascripts/gridx/modules/IndirectSelectColumn.js +277 -0
  167. data/app/assets/javascripts/gridx/modules/Menu.js +167 -0
  168. data/app/assets/javascripts/gridx/modules/NavigableCell.js +170 -0
  169. data/app/assets/javascripts/gridx/modules/NestedSort.js +280 -0
  170. data/app/assets/javascripts/gridx/modules/PagedBody.js +409 -0
  171. data/app/assets/javascripts/gridx/modules/Pagination.js +293 -0
  172. data/app/assets/javascripts/gridx/modules/Persist.js +266 -0
  173. data/app/assets/javascripts/gridx/modules/Printer.js +49 -0
  174. data/app/assets/javascripts/gridx/modules/RowHeader.js +412 -0
  175. data/app/assets/javascripts/gridx/modules/RowLock.js +143 -0
  176. data/app/assets/javascripts/gridx/modules/SingleSort.js +276 -0
  177. data/app/assets/javascripts/gridx/modules/SummaryBar.js +33 -0
  178. data/app/assets/javascripts/gridx/modules/TitleBar.js +51 -0
  179. data/app/assets/javascripts/gridx/modules/ToolBar.js +55 -0
  180. data/app/assets/javascripts/gridx/modules/TouchScroll.js +103 -0
  181. data/app/assets/javascripts/gridx/modules/TouchVScroller.js +89 -0
  182. data/app/assets/javascripts/gridx/modules/Traverse.js +159 -0
  183. data/app/assets/javascripts/gridx/modules/Tree.js +646 -0
  184. data/app/assets/javascripts/gridx/modules/VLayout.js +152 -0
  185. data/app/assets/javascripts/gridx/modules/VScroller.js +342 -0
  186. data/app/assets/javascripts/gridx/modules/View.js +540 -0
  187. data/app/assets/javascripts/gridx/modules/VirtualVScroller.js +445 -0
  188. data/app/assets/javascripts/gridx/modules/barPlugins/DropDownPager.js +16 -0
  189. data/app/assets/javascripts/gridx/modules/barPlugins/DropDownSizer.js +16 -0
  190. data/app/assets/javascripts/gridx/modules/barPlugins/GotoPageButton.js +16 -0
  191. data/app/assets/javascripts/gridx/modules/barPlugins/LinkPager.js +16 -0
  192. data/app/assets/javascripts/gridx/modules/barPlugins/LinkSizer.js +16 -0
  193. data/app/assets/javascripts/gridx/modules/barPlugins/Summary.js +16 -0
  194. data/app/assets/javascripts/gridx/modules/dnd/Avatar.js +45 -0
  195. data/app/assets/javascripts/gridx/modules/dnd/Column.js +210 -0
  196. data/app/assets/javascripts/gridx/modules/dnd/Row.js +286 -0
  197. data/app/assets/javascripts/gridx/modules/dnd/_Base.js +60 -0
  198. data/app/assets/javascripts/gridx/modules/dnd/_Dnd.js +371 -0
  199. data/app/assets/javascripts/gridx/modules/exporter/CSV.js +43 -0
  200. data/app/assets/javascripts/gridx/modules/exporter/Exporter.js +34 -0
  201. data/app/assets/javascripts/gridx/modules/exporter/Table.js +42 -0
  202. data/app/assets/javascripts/gridx/modules/extendedSelect/Cell.js +491 -0
  203. data/app/assets/javascripts/gridx/modules/extendedSelect/Column.js +290 -0
  204. data/app/assets/javascripts/gridx/modules/extendedSelect/Row.js +458 -0
  205. data/app/assets/javascripts/gridx/modules/extendedSelect/_Base.js +244 -0
  206. data/app/assets/javascripts/gridx/modules/extendedSelect/_RowCellBase.js +35 -0
  207. data/app/assets/javascripts/gridx/modules/filter/DistinctComboBoxMenu.js +22 -0
  208. data/app/assets/javascripts/gridx/modules/filter/Filter.js +16 -0
  209. data/app/assets/javascripts/gridx/modules/filter/FilterBar.js +649 -0
  210. data/app/assets/javascripts/gridx/modules/filter/FilterConfirmDialog.js +33 -0
  211. data/app/assets/javascripts/gridx/modules/filter/FilterDialog.js +179 -0
  212. data/app/assets/javascripts/gridx/modules/filter/FilterPane.js +340 -0
  213. data/app/assets/javascripts/gridx/modules/filter/FilterTooltip.js +103 -0
  214. data/app/assets/javascripts/gridx/modules/filter/QuickFilter.js +33 -0
  215. data/app/assets/javascripts/gridx/modules/move/Column.js +223 -0
  216. data/app/assets/javascripts/gridx/modules/move/Row.js +154 -0
  217. data/app/assets/javascripts/gridx/modules/pagination/Pagination.js +16 -0
  218. data/app/assets/javascripts/gridx/modules/pagination/PaginationBar.js +68 -0
  219. data/app/assets/javascripts/gridx/modules/pagination/PaginationBarDD.js +40 -0
  220. data/app/assets/javascripts/gridx/modules/pagination/_PaginationBarBase.js +105 -0
  221. data/app/assets/javascripts/gridx/modules/select/Cell.js +229 -0
  222. data/app/assets/javascripts/gridx/modules/select/Column.js +209 -0
  223. data/app/assets/javascripts/gridx/modules/select/Row.js +302 -0
  224. data/app/assets/javascripts/gridx/modules/select/_Base.js +99 -0
  225. data/app/assets/javascripts/gridx/modules/select/_RowCellBase.js +51 -0
  226. data/app/assets/javascripts/gridx/nls/Body.js +47 -0
  227. data/app/assets/javascripts/gridx/nls/FilterBar.js +133 -0
  228. data/app/assets/javascripts/gridx/nls/NestedSort.js +45 -0
  229. data/app/assets/javascripts/gridx/nls/PaginationBar.js +68 -0
  230. data/app/assets/javascripts/gridx/nls/QuickFilter.js +40 -0
  231. data/app/assets/javascripts/gridx/nls/SummaryBar.js +38 -0
  232. data/app/assets/javascripts/gridx/nls/ar/Body.js +11 -0
  233. data/app/assets/javascripts/gridx/nls/ar/FilterBar.js +89 -0
  234. data/app/assets/javascripts/gridx/nls/ar/NestedSort.js +11 -0
  235. data/app/assets/javascripts/gridx/nls/ar/PaginationBar.js +34 -0
  236. data/app/assets/javascripts/gridx/nls/ar/QuickFilter.js +7 -0
  237. data/app/assets/javascripts/gridx/nls/ar/SummaryBar.js +5 -0
  238. data/app/assets/javascripts/gridx/nls/bg/Body.js +11 -0
  239. data/app/assets/javascripts/gridx/nls/bg/FilterBar.js +88 -0
  240. data/app/assets/javascripts/gridx/nls/bg/NestedSort.js +12 -0
  241. data/app/assets/javascripts/gridx/nls/bg/PaginationBar.js +28 -0
  242. data/app/assets/javascripts/gridx/nls/bg/QuickFilter.js +8 -0
  243. data/app/assets/javascripts/gridx/nls/bg/SummaryBar.js +6 -0
  244. data/app/assets/javascripts/gridx/nls/ca/Body.js +11 -0
  245. data/app/assets/javascripts/gridx/nls/ca/FilterBar.js +89 -0
  246. data/app/assets/javascripts/gridx/nls/ca/NestedSort.js +13 -0
  247. data/app/assets/javascripts/gridx/nls/ca/PaginationBar.js +30 -0
  248. data/app/assets/javascripts/gridx/nls/ca/QuickFilter.js +9 -0
  249. data/app/assets/javascripts/gridx/nls/ca/SummaryBar.js +7 -0
  250. data/app/assets/javascripts/gridx/nls/cs/Body.js +11 -0
  251. data/app/assets/javascripts/gridx/nls/cs/FilterBar.js +89 -0
  252. data/app/assets/javascripts/gridx/nls/cs/NestedSort.js +11 -0
  253. data/app/assets/javascripts/gridx/nls/cs/PaginationBar.js +34 -0
  254. data/app/assets/javascripts/gridx/nls/cs/QuickFilter.js +7 -0
  255. data/app/assets/javascripts/gridx/nls/cs/SummaryBar.js +5 -0
  256. data/app/assets/javascripts/gridx/nls/da/Body.js +11 -0
  257. data/app/assets/javascripts/gridx/nls/da/FilterBar.js +89 -0
  258. data/app/assets/javascripts/gridx/nls/da/NestedSort.js +11 -0
  259. data/app/assets/javascripts/gridx/nls/da/PaginationBar.js +34 -0
  260. data/app/assets/javascripts/gridx/nls/da/QuickFilter.js +7 -0
  261. data/app/assets/javascripts/gridx/nls/da/SummaryBar.js +5 -0
  262. data/app/assets/javascripts/gridx/nls/de/Body.js +11 -0
  263. data/app/assets/javascripts/gridx/nls/de/FilterBar.js +89 -0
  264. data/app/assets/javascripts/gridx/nls/de/NestedSort.js +11 -0
  265. data/app/assets/javascripts/gridx/nls/de/PaginationBar.js +34 -0
  266. data/app/assets/javascripts/gridx/nls/de/QuickFilter.js +7 -0
  267. data/app/assets/javascripts/gridx/nls/de/SummaryBar.js +5 -0
  268. data/app/assets/javascripts/gridx/nls/el/Body.js +11 -0
  269. data/app/assets/javascripts/gridx/nls/el/FilterBar.js +89 -0
  270. data/app/assets/javascripts/gridx/nls/el/NestedSort.js +11 -0
  271. data/app/assets/javascripts/gridx/nls/el/PaginationBar.js +34 -0
  272. data/app/assets/javascripts/gridx/nls/el/QuickFilter.js +7 -0
  273. data/app/assets/javascripts/gridx/nls/el/SummaryBar.js +5 -0
  274. data/app/assets/javascripts/gridx/nls/es/Body.js +11 -0
  275. data/app/assets/javascripts/gridx/nls/es/FilterBar.js +89 -0
  276. data/app/assets/javascripts/gridx/nls/es/NestedSort.js +13 -0
  277. data/app/assets/javascripts/gridx/nls/es/PaginationBar.js +30 -0
  278. data/app/assets/javascripts/gridx/nls/es/QuickFilter.js +9 -0
  279. data/app/assets/javascripts/gridx/nls/es/SummaryBar.js +7 -0
  280. data/app/assets/javascripts/gridx/nls/fi/Body.js +11 -0
  281. data/app/assets/javascripts/gridx/nls/fi/FilterBar.js +89 -0
  282. data/app/assets/javascripts/gridx/nls/fi/NestedSort.js +11 -0
  283. data/app/assets/javascripts/gridx/nls/fi/PaginationBar.js +34 -0
  284. data/app/assets/javascripts/gridx/nls/fi/QuickFilter.js +7 -0
  285. data/app/assets/javascripts/gridx/nls/fi/SummaryBar.js +5 -0
  286. data/app/assets/javascripts/gridx/nls/fr/Body.js +11 -0
  287. data/app/assets/javascripts/gridx/nls/fr/FilterBar.js +89 -0
  288. data/app/assets/javascripts/gridx/nls/fr/NestedSort.js +11 -0
  289. data/app/assets/javascripts/gridx/nls/fr/PaginationBar.js +34 -0
  290. data/app/assets/javascripts/gridx/nls/fr/QuickFilter.js +7 -0
  291. data/app/assets/javascripts/gridx/nls/fr/SummaryBar.js +5 -0
  292. data/app/assets/javascripts/gridx/nls/he/Body.js +11 -0
  293. data/app/assets/javascripts/gridx/nls/he/FilterBar.js +89 -0
  294. data/app/assets/javascripts/gridx/nls/he/NestedSort.js +11 -0
  295. data/app/assets/javascripts/gridx/nls/he/PaginationBar.js +34 -0
  296. data/app/assets/javascripts/gridx/nls/he/QuickFilter.js +6 -0
  297. data/app/assets/javascripts/gridx/nls/he/SummaryBar.js +5 -0
  298. data/app/assets/javascripts/gridx/nls/hr/Body.js +11 -0
  299. data/app/assets/javascripts/gridx/nls/hr/FilterBar.js +89 -0
  300. data/app/assets/javascripts/gridx/nls/hr/NestedSort.js +11 -0
  301. data/app/assets/javascripts/gridx/nls/hr/PaginationBar.js +34 -0
  302. data/app/assets/javascripts/gridx/nls/hr/QuickFilter.js +7 -0
  303. data/app/assets/javascripts/gridx/nls/hr/SummaryBar.js +5 -0
  304. data/app/assets/javascripts/gridx/nls/hu/Body.js +11 -0
  305. data/app/assets/javascripts/gridx/nls/hu/FilterBar.js +89 -0
  306. data/app/assets/javascripts/gridx/nls/hu/NestedSort.js +11 -0
  307. data/app/assets/javascripts/gridx/nls/hu/PaginationBar.js +33 -0
  308. data/app/assets/javascripts/gridx/nls/hu/QuickFilter.js +7 -0
  309. data/app/assets/javascripts/gridx/nls/hu/SummaryBar.js +5 -0
  310. data/app/assets/javascripts/gridx/nls/it/Body.js +11 -0
  311. data/app/assets/javascripts/gridx/nls/it/FilterBar.js +89 -0
  312. data/app/assets/javascripts/gridx/nls/it/NestedSort.js +11 -0
  313. data/app/assets/javascripts/gridx/nls/it/PaginationBar.js +34 -0
  314. data/app/assets/javascripts/gridx/nls/it/QuickFilter.js +7 -0
  315. data/app/assets/javascripts/gridx/nls/it/SummaryBar.js +5 -0
  316. data/app/assets/javascripts/gridx/nls/ja/Body.js +11 -0
  317. data/app/assets/javascripts/gridx/nls/ja/FilterBar.js +89 -0
  318. data/app/assets/javascripts/gridx/nls/ja/NestedSort.js +11 -0
  319. data/app/assets/javascripts/gridx/nls/ja/PaginationBar.js +34 -0
  320. data/app/assets/javascripts/gridx/nls/ja/QuickFilter.js +7 -0
  321. data/app/assets/javascripts/gridx/nls/ja/SummaryBar.js +5 -0
  322. data/app/assets/javascripts/gridx/nls/kk/Body.js +11 -0
  323. data/app/assets/javascripts/gridx/nls/kk/FilterBar.js +89 -0
  324. data/app/assets/javascripts/gridx/nls/kk/NestedSort.js +13 -0
  325. data/app/assets/javascripts/gridx/nls/kk/PaginationBar.js +30 -0
  326. data/app/assets/javascripts/gridx/nls/kk/QuickFilter.js +9 -0
  327. data/app/assets/javascripts/gridx/nls/kk/SummaryBar.js +7 -0
  328. data/app/assets/javascripts/gridx/nls/ko/Body.js +11 -0
  329. data/app/assets/javascripts/gridx/nls/ko/FilterBar.js +89 -0
  330. data/app/assets/javascripts/gridx/nls/ko/NestedSort.js +11 -0
  331. data/app/assets/javascripts/gridx/nls/ko/PaginationBar.js +34 -0
  332. data/app/assets/javascripts/gridx/nls/ko/QuickFilter.js +7 -0
  333. data/app/assets/javascripts/gridx/nls/ko/SummaryBar.js +5 -0
  334. data/app/assets/javascripts/gridx/nls/nb/Body.js +11 -0
  335. data/app/assets/javascripts/gridx/nls/nb/FilterBar.js +89 -0
  336. data/app/assets/javascripts/gridx/nls/nb/NestedSort.js +11 -0
  337. data/app/assets/javascripts/gridx/nls/nb/PaginationBar.js +34 -0
  338. data/app/assets/javascripts/gridx/nls/nb/QuickFilter.js +7 -0
  339. data/app/assets/javascripts/gridx/nls/nb/SummaryBar.js +5 -0
  340. data/app/assets/javascripts/gridx/nls/nl/Body.js +11 -0
  341. data/app/assets/javascripts/gridx/nls/nl/FilterBar.js +89 -0
  342. data/app/assets/javascripts/gridx/nls/nl/NestedSort.js +11 -0
  343. data/app/assets/javascripts/gridx/nls/nl/PaginationBar.js +34 -0
  344. data/app/assets/javascripts/gridx/nls/nl/QuickFilter.js +7 -0
  345. data/app/assets/javascripts/gridx/nls/nl/SummaryBar.js +5 -0
  346. data/app/assets/javascripts/gridx/nls/pl/Body.js +11 -0
  347. data/app/assets/javascripts/gridx/nls/pl/FilterBar.js +89 -0
  348. data/app/assets/javascripts/gridx/nls/pl/NestedSort.js +11 -0
  349. data/app/assets/javascripts/gridx/nls/pl/PaginationBar.js +34 -0
  350. data/app/assets/javascripts/gridx/nls/pl/QuickFilter.js +7 -0
  351. data/app/assets/javascripts/gridx/nls/pl/SummaryBar.js +5 -0
  352. data/app/assets/javascripts/gridx/nls/pt/Body.js +11 -0
  353. data/app/assets/javascripts/gridx/nls/pt/FilterBar.js +89 -0
  354. data/app/assets/javascripts/gridx/nls/pt/NestedSort.js +13 -0
  355. data/app/assets/javascripts/gridx/nls/pt/PaginationBar.js +30 -0
  356. data/app/assets/javascripts/gridx/nls/pt/QuickFilter.js +9 -0
  357. data/app/assets/javascripts/gridx/nls/pt/SummaryBar.js +7 -0
  358. data/app/assets/javascripts/gridx/nls/pt-br/Body.js +6 -0
  359. data/app/assets/javascripts/gridx/nls/pt-br/FilterBar.js +89 -0
  360. data/app/assets/javascripts/gridx/nls/pt-br/NestedSort.js +11 -0
  361. data/app/assets/javascripts/gridx/nls/pt-br/PaginationBar.js +34 -0
  362. data/app/assets/javascripts/gridx/nls/pt-br/QuickFilter.js +7 -0
  363. data/app/assets/javascripts/gridx/nls/pt-br/SummaryBar.js +5 -0
  364. data/app/assets/javascripts/gridx/nls/pt-pt/Body.js +11 -0
  365. data/app/assets/javascripts/gridx/nls/pt-pt/FilterBar.js +89 -0
  366. data/app/assets/javascripts/gridx/nls/pt-pt/NestedSort.js +13 -0
  367. data/app/assets/javascripts/gridx/nls/pt-pt/PaginationBar.js +30 -0
  368. data/app/assets/javascripts/gridx/nls/pt-pt/QuickFilter.js +9 -0
  369. data/app/assets/javascripts/gridx/nls/pt-pt/SummaryBar.js +7 -0
  370. data/app/assets/javascripts/gridx/nls/ro/Body.js +11 -0
  371. data/app/assets/javascripts/gridx/nls/ro/FilterBar.js +89 -0
  372. data/app/assets/javascripts/gridx/nls/ro/NestedSort.js +13 -0
  373. data/app/assets/javascripts/gridx/nls/ro/PaginationBar.js +30 -0
  374. data/app/assets/javascripts/gridx/nls/ro/QuickFilter.js +9 -0
  375. data/app/assets/javascripts/gridx/nls/ro/SummaryBar.js +7 -0
  376. data/app/assets/javascripts/gridx/nls/ru/Body.js +11 -0
  377. data/app/assets/javascripts/gridx/nls/ru/FilterBar.js +89 -0
  378. data/app/assets/javascripts/gridx/nls/ru/NestedSort.js +11 -0
  379. data/app/assets/javascripts/gridx/nls/ru/PaginationBar.js +34 -0
  380. data/app/assets/javascripts/gridx/nls/ru/QuickFilter.js +7 -0
  381. data/app/assets/javascripts/gridx/nls/ru/SummaryBar.js +5 -0
  382. data/app/assets/javascripts/gridx/nls/sk/Body.js +11 -0
  383. data/app/assets/javascripts/gridx/nls/sk/FilterBar.js +89 -0
  384. data/app/assets/javascripts/gridx/nls/sk/NestedSort.js +13 -0
  385. data/app/assets/javascripts/gridx/nls/sk/PaginationBar.js +30 -0
  386. data/app/assets/javascripts/gridx/nls/sk/QuickFilter.js +9 -0
  387. data/app/assets/javascripts/gridx/nls/sk/SummaryBar.js +7 -0
  388. data/app/assets/javascripts/gridx/nls/sl/Body.js +11 -0
  389. data/app/assets/javascripts/gridx/nls/sl/FilterBar.js +89 -0
  390. data/app/assets/javascripts/gridx/nls/sl/NestedSort.js +11 -0
  391. data/app/assets/javascripts/gridx/nls/sl/PaginationBar.js +34 -0
  392. data/app/assets/javascripts/gridx/nls/sl/QuickFilter.js +7 -0
  393. data/app/assets/javascripts/gridx/nls/sl/SummaryBar.js +5 -0
  394. data/app/assets/javascripts/gridx/nls/sv/Body.js +11 -0
  395. data/app/assets/javascripts/gridx/nls/sv/FilterBar.js +89 -0
  396. data/app/assets/javascripts/gridx/nls/sv/NestedSort.js +11 -0
  397. data/app/assets/javascripts/gridx/nls/sv/PaginationBar.js +34 -0
  398. data/app/assets/javascripts/gridx/nls/sv/QuickFilter.js +7 -0
  399. data/app/assets/javascripts/gridx/nls/sv/SummaryBar.js +5 -0
  400. data/app/assets/javascripts/gridx/nls/th/Body.js +11 -0
  401. data/app/assets/javascripts/gridx/nls/th/FilterBar.js +89 -0
  402. data/app/assets/javascripts/gridx/nls/th/NestedSort.js +11 -0
  403. data/app/assets/javascripts/gridx/nls/th/PaginationBar.js +34 -0
  404. data/app/assets/javascripts/gridx/nls/th/QuickFilter.js +7 -0
  405. data/app/assets/javascripts/gridx/nls/th/SummaryBar.js +5 -0
  406. data/app/assets/javascripts/gridx/nls/tr/Body.js +11 -0
  407. data/app/assets/javascripts/gridx/nls/tr/FilterBar.js +89 -0
  408. data/app/assets/javascripts/gridx/nls/tr/NestedSort.js +11 -0
  409. data/app/assets/javascripts/gridx/nls/tr/PaginationBar.js +34 -0
  410. data/app/assets/javascripts/gridx/nls/tr/QuickFilter.js +7 -0
  411. data/app/assets/javascripts/gridx/nls/tr/SummaryBar.js +5 -0
  412. data/app/assets/javascripts/gridx/nls/uk/Body.js +11 -0
  413. data/app/assets/javascripts/gridx/nls/uk/FilterBar.js +88 -0
  414. data/app/assets/javascripts/gridx/nls/uk/NestedSort.js +12 -0
  415. data/app/assets/javascripts/gridx/nls/uk/PaginationBar.js +28 -0
  416. data/app/assets/javascripts/gridx/nls/uk/QuickFilter.js +8 -0
  417. data/app/assets/javascripts/gridx/nls/uk/SummaryBar.js +6 -0
  418. data/app/assets/javascripts/gridx/nls/zh/Body.js +11 -0
  419. data/app/assets/javascripts/gridx/nls/zh/FilterBar.js +89 -0
  420. data/app/assets/javascripts/gridx/nls/zh/NestedSort.js +11 -0
  421. data/app/assets/javascripts/gridx/nls/zh/PaginationBar.js +34 -0
  422. data/app/assets/javascripts/gridx/nls/zh/QuickFilter.js +7 -0
  423. data/app/assets/javascripts/gridx/nls/zh/SummaryBar.js +5 -0
  424. data/app/assets/javascripts/gridx/nls/zh-tw/Body.js +11 -0
  425. data/app/assets/javascripts/gridx/nls/zh-tw/FilterBar.js +89 -0
  426. data/app/assets/javascripts/gridx/nls/zh-tw/NestedSort.js +11 -0
  427. data/app/assets/javascripts/gridx/nls/zh-tw/PaginationBar.js +34 -0
  428. data/app/assets/javascripts/gridx/nls/zh-tw/QuickFilter.js +7 -0
  429. data/app/assets/javascripts/gridx/nls/zh-tw/SummaryBar.js +5 -0
  430. data/app/assets/javascripts/gridx/support/DropDownPager.js +111 -0
  431. data/app/assets/javascripts/gridx/support/DropDownSizer.js +112 -0
  432. data/app/assets/javascripts/gridx/support/GotoPageButton.js +92 -0
  433. data/app/assets/javascripts/gridx/support/GotoPagePane.js +61 -0
  434. data/app/assets/javascripts/gridx/support/LinkPager.js +180 -0
  435. data/app/assets/javascripts/gridx/support/LinkSizer.js +138 -0
  436. data/app/assets/javascripts/gridx/support/QuickFilter.js +138 -0
  437. data/app/assets/javascripts/gridx/support/Summary.js +49 -0
  438. data/app/assets/javascripts/gridx/support/_LinkPageBase.js +92 -0
  439. data/app/assets/javascripts/gridx/support/exporter/exporter.js +350 -0
  440. data/app/assets/javascripts/gridx/support/exporter/toCSV.js +75 -0
  441. data/app/assets/javascripts/gridx/support/exporter/toTable.js +92 -0
  442. data/app/assets/javascripts/gridx/support/menu/AZFilterMenu.js +57 -0
  443. data/app/assets/javascripts/gridx/support/menu/NumberFilterMenu.js +87 -0
  444. data/app/assets/javascripts/gridx/support/menu/_FilterMenuBase.js +83 -0
  445. data/app/assets/javascripts/gridx/support/printer.js +157 -0
  446. data/app/assets/javascripts/gridx/templates/FilterBar.html +8 -0
  447. data/app/assets/javascripts/gridx/templates/FilterConfirmDialog.html +5 -0
  448. data/app/assets/javascripts/gridx/templates/FilterDialog.html +19 -0
  449. data/app/assets/javascripts/gridx/templates/FilterPane.html +64 -0
  450. data/app/assets/javascripts/gridx/templates/GotoPagePane.html +28 -0
  451. data/app/assets/javascripts/gridx/templates/Grid.html +19 -0
  452. data/app/assets/javascripts/gridx/templates/LinkPager.html +24 -0
  453. data/app/assets/javascripts/gridx/templates/PaginationBar.html +60 -0
  454. data/app/assets/javascripts/gridx/templates/PaginationBarDD.html +23 -0
  455. data/app/assets/javascripts/gridx/templates/QuickFilter.html +38 -0
  456. data/app/assets/stylesheets/gridx/mobile/themes/iphone/Grid.css +107 -0
  457. data/app/assets/stylesheets/gridx/resources/Dod.css +39 -0
  458. data/app/assets/stylesheets/gridx/resources/Gridx.css +10 -0
  459. data/app/assets/stylesheets/gridx/resources/Gridx_rtl.css +5 -0
  460. data/app/assets/stylesheets/gridx/resources/Tree.css +46 -0
  461. data/app/assets/stylesheets/gridx/resources/Tree_rtl.css +4 -0
  462. data/app/assets/stylesheets/gridx/resources/bar.css +24 -0
  463. data/app/assets/stylesheets/gridx/resources/basic.css +482 -0
  464. data/app/assets/stylesheets/gridx/resources/basic_rtl.css +37 -0
  465. data/app/assets/stylesheets/gridx/resources/claro/Gridx.css +16 -0
  466. data/app/assets/stylesheets/gridx/resources/claro/Gridx_rtl.css +7 -0
  467. data/app/assets/stylesheets/gridx/resources/claro/basic.css +109 -0
  468. data/app/assets/stylesheets/gridx/resources/claro/basic_rtl.css +21 -0
  469. data/app/assets/stylesheets/gridx/resources/claro/filter.css +47 -0
  470. data/app/assets/stylesheets/gridx/resources/claro/lock.css +19 -0
  471. data/app/assets/stylesheets/gridx/resources/claro/pagination.css +33 -0
  472. data/app/assets/stylesheets/gridx/resources/claro/select.css +20 -0
  473. data/app/assets/stylesheets/gridx/resources/dnd.css +108 -0
  474. data/app/assets/stylesheets/gridx/resources/filter.css +321 -0
  475. data/app/assets/stylesheets/gridx/resources/filter_rtl.css +38 -0
  476. data/app/assets/stylesheets/gridx/resources/lock.css +20 -0
  477. data/app/assets/stylesheets/gridx/resources/pagination.css +142 -0
  478. data/app/assets/stylesheets/gridx/resources/pagination_rtl.css +54 -0
  479. data/app/assets/stylesheets/gridx/resources/select.css +39 -0
  480. data/app/assets/stylesheets/gridx/resources/sort.css +154 -0
  481. data/app/assets/stylesheets/gridx/resources/sort_rtl.css +51 -0
  482. data/lib/gridx-rails/engine.rb +8 -0
  483. data/lib/gridx-rails/version.rb +3 -0
  484. data/lib/gridx-rails.rb +4 -0
  485. data/lib/tasks/gridx-rails_tasks.rake +52 -0
  486. data/test/dummy/README.rdoc +261 -0
  487. data/test/dummy/Rakefile +7 -0
  488. data/test/dummy/app/assets/javascripts/application.js +15 -0
  489. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  490. data/test/dummy/app/controllers/application_controller.rb +3 -0
  491. data/test/dummy/app/helpers/application_helper.rb +2 -0
  492. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  493. data/test/dummy/config/application.rb +59 -0
  494. data/test/dummy/config/boot.rb +10 -0
  495. data/test/dummy/config/database.yml +25 -0
  496. data/test/dummy/config/environment.rb +5 -0
  497. data/test/dummy/config/environments/development.rb +37 -0
  498. data/test/dummy/config/environments/production.rb +67 -0
  499. data/test/dummy/config/environments/test.rb +37 -0
  500. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  501. data/test/dummy/config/initializers/inflections.rb +15 -0
  502. data/test/dummy/config/initializers/mime_types.rb +5 -0
  503. data/test/dummy/config/initializers/secret_token.rb +7 -0
  504. data/test/dummy/config/initializers/session_store.rb +8 -0
  505. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  506. data/test/dummy/config/locales/en.yml +5 -0
  507. data/test/dummy/config/routes.rb +58 -0
  508. data/test/dummy/config.ru +4 -0
  509. data/test/dummy/db/test.sqlite3 +0 -0
  510. data/test/dummy/log/test.log +78 -0
  511. data/test/dummy/public/404.html +26 -0
  512. data/test/dummy/public/422.html +26 -0
  513. data/test/dummy/public/500.html +25 -0
  514. data/test/dummy/public/favicon.ico +0 -0
  515. data/test/dummy/script/rails +6 -0
  516. data/test/gridx-rails_test.rb +7 -0
  517. data/test/test_helper.rb +15 -0
  518. metadata +621 -0
@@ -0,0 +1,320 @@
1
+ define([
2
+ "dojo/_base/declare",
3
+ "dojo/_base/array",
4
+ "dojo/_base/Deferred",
5
+ "dojo/query",
6
+ "dojo/_base/sniff",
7
+ "dojo/dom-geometry",
8
+ "dojo/dom-class",
9
+ "dojo/dom-style",
10
+ "dojo/keys",
11
+ "../core/_Module"
12
+ ], function(declare, array, Deferred, query, has, domGeometry, domClass, domStyle, keys, _Module){
13
+
14
+ /*=====
15
+ return declare(_Module, {
16
+ // summary:
17
+ // module name: columnWidth.
18
+ // Manages column width distribution, allow grid autoWidth and column autoResize.
19
+
20
+ // default: Number
21
+ // Default column width. Applied when it's not possible to decide accurate column width from user's config.
22
+ 'default': 60,
23
+
24
+ // autoResize: Boolean
25
+ // If set to true, the column width should be set to auto or percentage values,
26
+ // so that the column can automatically resize when the grid width is changed.
27
+ // (This is the default behavior of an HTML table).
28
+ autoResize: false,
29
+
30
+ onUpdate: function(){
31
+ // summary:
32
+ // Fired when column widths are updated.
33
+ }
34
+ });
35
+ =====*/
36
+
37
+ var needHackPadBorder = has('safari') < 6 || (!has('safari') && has('webkit') && has('ios'));
38
+
39
+ function calcAutoWidth(autoCols, freeWidth, padBorder){
40
+ autoCols.sort(function(c1, c2){
41
+ return (c1.minWidth || 0) - (c2.minWidth || 0);
42
+ });
43
+ var i = autoCols.length - 1, c;
44
+ for(; i >= 0; --i){
45
+ c = autoCols[i];
46
+ if(c.minWidth && (c.minWidth + padBorder) * (i + 1) > freeWidth){
47
+ c.width = c.minWidth + 'px';
48
+ freeWidth -= c.minWidth + padBorder;
49
+ }else{
50
+ break;
51
+ }
52
+ }
53
+ var len = i + 1;
54
+ if(len){
55
+ var w = Math.floor(freeWidth / len - padBorder);
56
+ var ww = freeWidth - (w + padBorder) * (len - 1) - padBorder;
57
+ if(w < 0){
58
+ w = 0;
59
+ }
60
+ if(ww < 0){
61
+ ww = 0;
62
+ }
63
+ for(i = 0; i < len; ++i){
64
+ c = autoCols[i];
65
+ c.width = (i ? w : ww) + 'px';
66
+ }
67
+ }
68
+ }
69
+
70
+ return declare(_Module, {
71
+ name: 'columnWidth',
72
+
73
+ forced: ['hLayout'],
74
+
75
+ constructor: function(){
76
+ this._init();
77
+ },
78
+
79
+ load: function(){
80
+ var t = this,
81
+ g = t.grid;
82
+ t.aspect(g.hLayout, 'onUpdateWidth', '_onUpdateWidth');
83
+ t.aspect(g, 'setColumns', '_onSetColumns');
84
+ t._adaptWidth();
85
+ t.loaded.callback();
86
+ },
87
+
88
+ //Public-----------------------------------------------------------------------------
89
+ 'default': 60,
90
+
91
+ autoResize: false,
92
+
93
+ onUpdate: function(){},
94
+
95
+ //Private-----------------------------------------------------------------------------
96
+ _init: function(){
97
+ var t = this,
98
+ g = t.grid,
99
+ autoResize = t.arg('autoResize'),
100
+ defaultWidth = t.arg('default') + 'px';
101
+ array.forEach(g._columns, function(col){
102
+ if(!col.hasOwnProperty('declaredWidth')){
103
+ col.declaredWidth = col.width = col.width || 'auto';
104
+ }
105
+ if(g.autoWidth && (col.declaredWidth == 'auto' || /%$/.test(col.declaredWidth))){
106
+ //If minWidth exists, check it
107
+ col.width = t['default'] < col.minWidth ? col.minWidth + 'px' : defaultWidth;
108
+ }else if(autoResize && !(/%$/).test(col.declaredWidth)){
109
+ col.width = 'auto';
110
+ }
111
+ });
112
+ if(autoResize){
113
+ domClass.add(g.domNode, 'gridxPercentColumnWidth');
114
+ }
115
+ },
116
+
117
+ _onUpdateWidth: function(){
118
+ var t = this,
119
+ g = t.grid;
120
+ if(g.autoWidth){
121
+ t._adaptWidth();
122
+ }else{
123
+ var noHScroller = g.hScrollerNode.style.display == 'none',
124
+ autoResize = t.autoResize;
125
+ t._adaptWidth(!noHScroller, 1); //1 as true
126
+ if(!autoResize && noHScroller){
127
+ query('.gridxCell', g.bodyNode).forEach(function(cellNode){
128
+ var col = g._columnsById[cellNode.getAttribute('colId')],
129
+ declaredWidth = col.declaredWidth;
130
+ if(autoResize || !declaredWidth || declaredWidth == 'auto' || (/%$/).test(declaredWidth)){
131
+ var s = cellNode.style,
132
+ w = col.width;
133
+ s.width = w;
134
+ s.minWidth = w;
135
+ s.maxWidth = w;
136
+ }
137
+ });
138
+ }
139
+ t.onUpdate();
140
+ }
141
+ },
142
+
143
+ _adaptWidth: function(skip, noEvent){
144
+ var t = this,
145
+ g = t.grid,
146
+ dn = g.domNode,
147
+ header = g.header,
148
+ ltr = g.isLeftToRight(),
149
+ marginLead = ltr ? 'marginLeft' : 'marginRight',
150
+ marginTail = ltr ? 'marginRight' : 'marginLeft',
151
+ lead = g.hLayout.lead,
152
+ tail = g.hLayout.tail,
153
+ innerNode = header.innerNode,
154
+ bs = g.bodyNode.style,
155
+ hs = innerNode.style,
156
+ headerBorder = domGeometry.getBorderExtents(header.domNode).w,
157
+ tailBorder = headerBorder,
158
+ mainBorder = 0,
159
+ bodyWidth = (dn.clientWidth || domStyle.get(dn, 'width')) - lead - tail - headerBorder,
160
+ refNode = query('.gridxCell', innerNode)[0],
161
+ padBorder = refNode ? domGeometry.getMarginBox(refNode).w - domGeometry.getContentBox(refNode).w : 0,
162
+ isGroupHeader = g.header.arg('groups'),
163
+ isGridHidden = !dn.offsetHeight;
164
+ t._padBorder = padBorder;
165
+ //FIXME: this is theme dependent. Any better way to do this?
166
+ if(tailBorder === 0){
167
+ tailBorder = 1;
168
+ }else{
169
+ mainBorder = 2;
170
+ }
171
+ hs[marginLead] = lead + 'px';
172
+ hs[marginTail] = (tail > tailBorder ? tail - tailBorder : 0) + 'px';
173
+ g.mainNode.style[marginLead] = lead + 'px';
174
+ g.mainNode.style[marginTail] = tail + 'px';
175
+ bodyWidth = bodyWidth < 0 ? 0 : bodyWidth;
176
+ if(skip){
177
+ t.onUpdate();
178
+ return;
179
+ }
180
+ if(!t.arg('autoResize')){
181
+ if(needHackPadBorder){
182
+ query('.gridxCell', innerNode).forEach(function(node){
183
+ var c = g._columnsById[node.getAttribute('colid')];
184
+ if(/px$/.test(c.declaredWidth)){
185
+ var w = parseInt(c.declaredWidth, 10) + padBorder;
186
+ w = c.width = w + 'px';
187
+ node.style.width = w;
188
+ node.style.minWidth = w;
189
+ node.style.maxWidth = w;
190
+ }
191
+ });
192
+ }
193
+ }
194
+ if(g.autoWidth){
195
+ var headers = query('.gridxCell', innerNode),
196
+ totalWidth = 0;
197
+ headers.forEach(function(node){
198
+ var c = g._columnsById[node.getAttribute('colid')];
199
+ var w = domStyle.get(node, 'width');
200
+ if(isGroupHeader || !needHackPadBorder || !isGridHidden){
201
+ w += padBorder;
202
+ }
203
+ if(w < c.minWidth){
204
+ w = c.minWidth;
205
+ }
206
+ totalWidth += w;
207
+ if(c.width == 'auto' || (/%$/).test(c.width)){
208
+ node.style.width = c.width = w + 'px';
209
+ node.style.minWidth = c.width;
210
+ node.style.maxWidth = c.width;
211
+ }
212
+ });
213
+ bs.width = totalWidth + 'px';
214
+ dn.style.width = (lead + tail + totalWidth + mainBorder) + 'px';
215
+ }else if(t.arg('autoResize')){
216
+ hs.borderWidth = g.vScrollerNode.style.display == 'none' ? 0 : '';
217
+ }else{
218
+ var autoCols = [],
219
+ cols = g._columns,
220
+ fixedWidth = 0;
221
+ if(!isGroupHeader && needHackPadBorder){
222
+ padBorder = 0;
223
+ }
224
+ array.forEach(cols, function(c){
225
+ if(c.declaredWidth == 'auto'){
226
+ autoCols.push(c);
227
+ }else if(/%$/.test(c.declaredWidth)){
228
+ var w = parseInt(bodyWidth * parseFloat(c.declaredWidth, 10) / 100 - padBorder, 10);
229
+ //Check if less than zero, prevent error in IE.
230
+ if(w < 0){
231
+ w = 0;
232
+ }
233
+ if(typeof c.minWidth == 'number' && w < c.minWidth){
234
+ w = c.minWidth;
235
+ }
236
+ var node = header.getHeaderNode(c.id);
237
+ node.style.width = c.width = w + 'px';
238
+ node.style.minWidth = c.width;
239
+ node.style.maxWidth = c.width;
240
+ }
241
+ });
242
+ array.forEach(cols, function(c){
243
+ if(c.declaredWidth != 'auto'){
244
+ var headerNode = header.getHeaderNode(c.id),
245
+ w = !isGroupHeader && needHackPadBorder ? parseFloat(headerNode.style.width, 10) :
246
+ headerNode.offsetWidth || (domStyle.get(headerNode, 'width') + padBorder);
247
+ if(/%$/.test(c.declaredWidth)){
248
+ c.width = (w > padBorder ? w - padBorder : 0) + 'px';
249
+ }
250
+ fixedWidth += w;
251
+ }
252
+ });
253
+ if(autoCols.length){
254
+ var freeWidth = bodyWidth - fixedWidth;
255
+ if(freeWidth > 0){
256
+ calcAutoWidth(autoCols, freeWidth, padBorder);
257
+ }else{
258
+ var w = t.arg('default');
259
+ array.forEach(autoCols, function(c, i){
260
+ var cw = w;
261
+ if(typeof c.minWidth == 'number' && cw < c.minWidth){
262
+ cw = c.minWidth;
263
+ }
264
+ c.width = cw + 'px';
265
+ });
266
+ }
267
+ array.forEach(autoCols, function(c, i){
268
+ var node = header.getHeaderNode(c.id);
269
+ node.style.width = c.width;
270
+ node.style.minWidth = c.width;
271
+ node.style.maxWidth = c.width;
272
+ });
273
+ }
274
+ }
275
+ if(isGroupHeader){
276
+ // If group header is used, the column width might not be set properly
277
+ // (min-width/max-width not working when colspan cells exist).
278
+ // So the actual width of the node is honored.
279
+ query('.gridxCell', header.innerNode).forEach(function(node){
280
+ var col = g._columnsById[node.getAttribute('colid')];
281
+ if(/px$/.test(col.width)){
282
+ var width = node.clientWidth - domGeometry.getPadExtents(node).w;
283
+ if(parseInt(col.width, 10) != width){
284
+ col.width = width = width + 'px';
285
+ node.style.width = width;
286
+ node.style.minWidth = width;
287
+ node.style.maxWidth = width;
288
+ }
289
+ }
290
+ });
291
+ }
292
+ g.hScroller.scroll(0);
293
+ header._onHScroll(0);
294
+ g.vLayout.reLayout();
295
+ if(!noEvent){
296
+ t.onUpdate();
297
+ }
298
+ },
299
+
300
+ _onSetColumns: function(){
301
+ var t = this,
302
+ g = t.grid;
303
+ t._init();
304
+ //Now header and body can be different, so we should not trigger any onRender event at this inconsistent stage,
305
+ g.header._build();
306
+ t._adaptWidth();
307
+ //FIXME: Is there any more elegant way to do this?
308
+ if(g.cellWidget){
309
+ g.cellWidget._init();
310
+ if(g.edit){
311
+ g.edit._init();
312
+ }
313
+ }
314
+ if(g.tree){
315
+ g.tree._initExpandLevel();
316
+ }
317
+ g.body.refresh();
318
+ }
319
+ });
320
+ });
@@ -0,0 +1,368 @@
1
+ define([
2
+ "dojo/_base/kernel",
3
+ "dojo/dom-construct",
4
+ "dojo/dom-style",
5
+ "dojo/dom-class",
6
+ "dojo/dom-geometry",
7
+ "dojo/_base/lang",
8
+ "dojo/_base/Deferred",
9
+ "../core/_Module",
10
+ "dojo/_base/declare",
11
+ "dojo/_base/fx",
12
+ "dojo/fx",
13
+ "dojo/query"
14
+ ], function(kernel, domConstruct, domStyle, domClass, domGeometry, lang, Deferred, _Module, declare, baseFx, fx, query){
15
+ kernel.experimental('gridx/modules/Dod');
16
+
17
+ /*=====
18
+ return declare(_Module, {
19
+ // summary:
20
+ // Details on demand.
21
+
22
+ // useAnimation: Boolean
23
+ // Indicates whether to use animation (slide) when showing/hiding the detail part.
24
+ useAnimation: true,
25
+
26
+ // duration: Number
27
+ // The time used to play the animation.
28
+ duration: 750,
29
+
30
+ defaultShow: false,
31
+
32
+ showExpando: true,
33
+
34
+ show: function(row){
35
+ // summary:
36
+ // Show the detail part of a row, if this row has a detail part.
37
+ // Use animation (slide the detail part out) if useAnimation is true.
38
+ // Nothing happens if rowId is not valid or the row does not has a detail part.
39
+ // rowId: String
40
+ // The ID of a row.
41
+ // return: dojo.Deferred.
42
+ // A deferred object indicating when the detail is completely shown.
43
+ },
44
+
45
+ hide: function(row){
46
+ // summary:
47
+ // Hide the detail part of a row, if this row has a detail part.
48
+ // Use animation (slide the detail part in) if useAnimation is true.
49
+ // Nothing happens if rowId is not valid or the row does not has a detail part.
50
+ // rowId: String
51
+ // The ID of a row.
52
+ // return: dojo.Deferred.
53
+ // A deferred object indicating when the detail is completely hidden.
54
+ },
55
+
56
+ toggle: function(row){
57
+ },
58
+
59
+ refresh: function(row){
60
+ },
61
+
62
+ isShown: function(row){
63
+ },
64
+
65
+ onShow: function(row){},
66
+ onHide: function(row){}
67
+ });
68
+ =====*/
69
+
70
+ return declare(_Module, {
71
+ name: 'dod',
72
+ required: ['body'],
73
+ useAnimation: true,
74
+ duration: 750,
75
+ defaultShow: false,
76
+ showExpando: true,
77
+ load: function(args, deferStartup){
78
+ this._rowMap = {};
79
+ this.connect(this.grid.body, 'onAfterCell', '_onAfterCell');
80
+ this.connect(this.grid.body, 'onAfterRow', '_onAfterRow');
81
+ this.connect(this.grid.bodyNode, 'onclick', '_onBodyClick');
82
+ this.connect(this.grid.body, 'onUnrender', '_onBodyUnrender');
83
+ if(this.grid.columnResizer){
84
+ this.connect(this.grid.columnResizer, 'onResize', '_onColumnResize');
85
+ }
86
+ this.loaded.callback();
87
+
88
+ },
89
+ rowMixin: {
90
+ showDetail: function(){
91
+ this.grid.dod.show(this);
92
+ },
93
+ hideDetail: function(){
94
+ this.grid.dod.hide(this);
95
+ },
96
+ toggleDetail: function(){
97
+ this.grid.dod.toggle(this);
98
+ },
99
+ refreshDetail: function(){
100
+ this.grid.dod.refreshDetail(this);
101
+ },
102
+ isDetailShown: function(){
103
+ return this.grid.dod.isShown(this);
104
+ }
105
+ },
106
+
107
+ show: function(row){
108
+ var _row = this._row(row);
109
+ if(_row.dodShown || _row.inAnim || !row.node()){return;}
110
+
111
+ _row.dodShown = true;
112
+ var expando = this._getExpando(row);
113
+ if(expando){expando.firstChild.innerHTML = '-';}
114
+
115
+ var node = row.node(), w = node.scrollWidth;
116
+ if(!_row.dodLoadingNode){
117
+ _row.dodLoadingNode = domConstruct.create('div', {
118
+ className: 'gridxDodLoadNode',
119
+ innerHTML: 'Loading...'
120
+ });
121
+ }
122
+ if(!_row.dodNode){
123
+ _row.dodNode = domConstruct.create('div', {className: 'gridxDodNode'});
124
+ }
125
+ domConstruct.place(_row.dodLoadingNode, node, 'last');
126
+ domConstruct.place(_row.dodNode, node, 'last');
127
+ domStyle.set(_row.dodLoadingNode, 'width', w + 'px');
128
+ domStyle.set(_row.dodNode, 'width', w + 'px');
129
+
130
+ domClass.add(node, 'gridxDodShown');
131
+ domStyle.set(_row.dodNode, 'display', 'none');
132
+
133
+ if(_row.dodLoaded){
134
+ this._detailLoadComplete(row);
135
+ return;
136
+ }else{
137
+ domStyle.set(_row.dodLoadingNode, 'display', 'block');
138
+ }
139
+
140
+ if(this.grid.rowHeader){
141
+ var rowHeaderNode = query('[rowid="' + this.grid._escapeId(row.id) + '"].gridxRowHeaderRow', this.grid.rowHeader.bodyNode)[0];
142
+ //TODO: 1 is the border for claro theme, will fix
143
+ domStyle.set(rowHeaderNode.firstChild, 'height', domStyle.get(row.node(), 'height') + 'px');
144
+ }
145
+
146
+ var df = new Deferred(), _this = this;
147
+ if(this.arg('detailProvider')){
148
+ this.detailProvider(this.grid, row.id, _row.dodNode, df);
149
+ }else{
150
+ df.callback();
151
+ }
152
+ df.then(
153
+ lang.hitch(this, '_detailLoadComplete', row),
154
+ lang.hitch(this, '_detailLoadError', row)
155
+ );
156
+
157
+ },
158
+
159
+ hide: function(row){
160
+ var _row = this._row(row), g = this.grid, escapeId = g._escapeId;
161
+ if(!_row.dodShown || _row.inAnim || !row.node()){return;}
162
+ domClass.remove(row.node(), 'gridxDodShown');
163
+ domStyle.set(_row.dodLoadingNode, 'display', 'none');
164
+ if(this.grid.rowHeader){
165
+ var rowHeaderNode = query('[rowid="' + escapeId(row.id) + '"].gridxRowHeaderRow', this.grid.rowHeader.bodyNode)[0];
166
+ domStyle.set(rowHeaderNode.firstChild, 'height', domStyle.get(row.node(), 'height') - 1 + 'px');
167
+ //TODO: 1 is the border for claro theme, will fix
168
+ }
169
+ var expando = this._getExpando(row);
170
+ if(expando){expando.firstChild.innerHTML = '+';}
171
+
172
+ if(this.arg('useAnimation')){
173
+ _row.inAnim = true;
174
+ fx.wipeOut({
175
+ node: _row.dodNode,
176
+ duration: this.arg('duration'),
177
+ onEnd: function(){
178
+ _row.dodShown = false;
179
+ _row.inAnim = false;
180
+ g.body.onRender();
181
+ }
182
+ }).play();
183
+ if(this.grid.rowHeader){
184
+ var rowHeaderNode = query('[rowid="' + escapeId(row.id) + '"].gridxRowHeaderRow', this.grid.rowHeader.bodyNode)[0];
185
+ baseFx.animateProperty({ node: rowHeaderNode.firstChild, duration:this.arg('duration'),
186
+ properties: {
187
+ height: { start:rowHeaderNode.offsetHeight, end:rowHeaderNode.offsetHeight - _row.dodNode.scrollHeight, units:"px" }
188
+ }
189
+ }).play();
190
+ }
191
+ }else{
192
+ _row.dodShown = false;
193
+ _row.inAnim = false;
194
+ _row.dodNode.style.display = 'none';
195
+ g.body.onRender();
196
+ if(this.grid.rowHeader){
197
+ var rowHeaderNode = query('[rowid="' + escapeId(row.id) + '"].gridxRowHeaderRow', this.grid.rowHeader.bodyNode)[0];
198
+ rowHeaderNode.firstChild.style.height = rowHeaderNode.offsetHeight - _row.dodNode.scrollHeight + 'px';
199
+ }
200
+
201
+ }
202
+
203
+ _row.defaultShow = false;
204
+ },
205
+
206
+ toggle: function(row){
207
+ if(this.isShown(row)){
208
+ this.hide(row);
209
+ }else{
210
+ this.show(row);
211
+ }
212
+ },
213
+ refresh: function(row){
214
+ var _row = this._row(row);
215
+ _row.dodLoaded = false;
216
+ this.show(row);
217
+ },
218
+
219
+ isShown: function(row){
220
+ var _row = this._row(row);
221
+ return !!_row.dodShown;
222
+ },
223
+
224
+ onShow: function(row){},
225
+ onHide: function(row){},
226
+
227
+ //private
228
+ _rowMap: null,
229
+ _lastOpen: null, //only useful when autoClose is true.
230
+ _row: function(/*id|obj*/row){
231
+ var id = row;
232
+ if(typeof row === 'object'){
233
+ id = row.id;
234
+ }
235
+ return this._rowMap[id] || (this._rowMap[id] = {});
236
+ },
237
+
238
+ _onBodyClick: function(e){
239
+ if(!domClass.contains(e.target, 'gridxDodExpando') && !domClass.contains(e.target, 'gridxDodExpandoText')){return;}
240
+ var node = e.target;
241
+ while(node && !domClass.contains(node, 'gridxRow')){
242
+ node = node.parentNode;
243
+ }
244
+ var idx = node.getAttribute('rowindex');
245
+ this.toggle(this.grid.row(parseInt(idx)));
246
+ },
247
+
248
+ _onAfterRow: function(row){
249
+
250
+ var _row = this._row(row);
251
+ if(this.arg('showExpando')){
252
+ var tbl = query('table', row.node())[0];
253
+ var cell = tbl.rows[0].cells[0];
254
+ var span = domConstruct.create('span', {
255
+ className: 'gridxDodExpando',
256
+ innerHTML: '<span class="gridxDodExpandoText">'
257
+ + (this.arg('defaultShow') ? '-' : '+') + '</span>'
258
+ }, cell, 'first');
259
+ }
260
+
261
+ if(this.isShown(row) || (this.arg('defaultShow') && _row.dodShown === undefined)){
262
+ _row.dodShown = false;
263
+ _row.defaultShow = true;
264
+ this.show(row);
265
+ }
266
+
267
+ },
268
+
269
+ _onBodyUnrender: function(row){
270
+ // Remove the cache for the row when it is destroyed, so that dod recreates
271
+ // necessary dom nodes when the row is rendered again.
272
+ if(!row){return;}
273
+ var _row = this._row(row);
274
+ if(!_row){return;}
275
+
276
+ function _removeNode(node){
277
+ if(node && node.parentNode){
278
+ node.parentNode.removeChild(node);
279
+ }
280
+ }
281
+
282
+ _removeNode(_row.dodNode);
283
+ _removeNode(_row.dodLoadingNode);
284
+ },
285
+
286
+ _onAfterCell: function(cell){
287
+ //when the first cell's content is changed, update the expando
288
+ if(this.arg('showExpando') && cell.node().cellIndex == 0){
289
+ this._onAfterRow(cell.row);
290
+ }
291
+ },
292
+
293
+ _onColumnResize: function(){
294
+ query('.gridxDodNode', this.grid.bodyNode).forEach(function(node){
295
+ domStyle.set(node, 'width', node.parentNode.firstChild.offsetWidth + 'px');
296
+ });
297
+ },
298
+
299
+ _detailLoadComplete: function(row){
300
+ var _row = this._row(row), g = this.grid, escapeId = g._escapeId;
301
+ if(!this.isShown(row)){return;}
302
+ _row.dodLoaded = true;
303
+
304
+ if(_row.defaultShow){
305
+ domStyle.set(_row.dodNode, 'display', 'block');
306
+ g.body.onRender();
307
+ }else{
308
+ if(domStyle.get(_row.dodLoadingNode, 'display') == 'block'){
309
+ domGeometry.setMarginBox(_row.dodNode, {h: domGeometry.getMarginBox(_row.dodLoadingNode).h});
310
+ domStyle.set(_row.dodNode, 'display', 'block');
311
+ }
312
+
313
+ if(this.arg('useAnimation')){
314
+ _row.inAnim = true;
315
+ fx.wipeIn({
316
+ node: _row.dodNode,
317
+ duration: this.arg('duration'),
318
+ onEnd: function(){
319
+ _row.inAnim = false;
320
+ g.body.onRender();
321
+ }
322
+ }).play();
323
+
324
+ if(this.grid.rowHeader){
325
+ var rowHeaderNode = query('[rowid="' + escapeId(row.id) + '"].gridxRowHeaderRow', this.grid.rowHeader.bodyNode)[0];
326
+ baseFx.animateProperty({ node: rowHeaderNode.firstChild, duration:this.arg('duration'),
327
+ properties: {
328
+ height: { start:rowHeaderNode.offsetHeight, end:row.node().firstChild.offsetHeight + _row.dodNode.scrollHeight, units:"px" }
329
+ }
330
+ }).play();
331
+ }
332
+ }else{
333
+ _row.dodNode.style.display = 'block';
334
+ _row.dodNode.style.height = 'auto';
335
+ g.body.onRender();
336
+ if(this.grid.rowHeader){
337
+ var rowHeaderNode = query('[rowid="' + escapeId(row.id) + '"].gridxRowHeaderRow', this.grid.rowHeader.bodyNode)[0];
338
+ rowHeaderNode.firstChild.style.height = row.node().firstChild.offsetHeight + _row.dodNode.scrollHeight + 'px';
339
+ }
340
+
341
+ }
342
+ }
343
+ domStyle.set(_row.dodLoadingNode, 'display', 'none');
344
+ },
345
+ _detailLoadError: function(row){
346
+ var _row = this._row(row);
347
+ _row.dodLoaded = false;
348
+ if(!this.isShown(row)){return;}
349
+ _row.dodLoadingNode.innerHTML = 'Error: failed to load detail.';
350
+ },
351
+ _showLoading: function(row){
352
+ var _row = this._row(row);
353
+ var node = _row.dodLoadingNode;
354
+ node.innerHTML = 'Loading...';
355
+ },
356
+ _getExpando: function(row){
357
+ if(!this.showExpando)return null;
358
+ var tbl = query('table', row.node())[0];
359
+ var cell = tbl.rows[0].cells[0];
360
+ return cell.firstChild;
361
+ },
362
+
363
+
364
+ //Focus
365
+
366
+ endFunc: function(){}
367
+ });
368
+ });