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,458 @@
1
+ define([
2
+ /*====="../../core/Row", =====*/
3
+ "dojo/_base/declare",
4
+ "dojo/_base/array",
5
+ "dojo/_base/event",
6
+ "dojo/query",
7
+ "dojo/_base/lang",
8
+ "dojo/_base/Deferred",
9
+ "dojo/_base/sniff",
10
+ "dojo/dom-class",
11
+ "dojo/mouse",
12
+ "dojo/keys",
13
+ "../../core/_Module",
14
+ "./_RowCellBase"
15
+ ], function(/*=====Row, =====*/declare, array, event, query, lang, Deferred, has, domClass, mouse, keys, _Module, _RowCellBase){
16
+
17
+ /*=====
18
+ Row.select = function(){
19
+ // summary:
20
+ // Select this row.
21
+ };
22
+ Row.deselect = function(){
23
+ // summary:
24
+ // Deselect this row.
25
+ };
26
+ Row.isSelected = function(){
27
+ // summary:
28
+ // Check whether this row is selected.
29
+ };
30
+ Row.isSelectable = function(){
31
+ // summary:
32
+ // Check whether this row is selectable.
33
+ };
34
+ Row.setSelectable = function(selectable){
35
+ // summary:
36
+ // Set this row to be selectable or not.
37
+ };
38
+
39
+ return declare(_RowCellBase, {
40
+ // summary:
41
+ // Provides advanced row selections.
42
+ // description:
43
+ // This module provides an advanced way for selecting rows by clicking, swiping, SPACE key, or CTRL/SHIFT CLICK to select multiple rows.
44
+ // This module uses gridx/core/model/extensions/Mark.
45
+ //
46
+ // example:
47
+ // 1. Use select api on grid row object obtained from grid.row(i)
48
+ // | grid.row(1).select();
49
+ // | grid.row(1).deselect();
50
+ // | grid.row(1).isSelected();
51
+ //
52
+ // 2. Use select api on select.row module
53
+ // | grid.select.row.selectById(rowId);
54
+ // | grid.select.row.deSelectById(rowId);
55
+ // | grid.select.row.isSelected(rowId);
56
+ // | grid.select.row.getSelected();//[]
57
+ // | grid.select.row.clear();
58
+
59
+ // triggerOnCell: Boolean
60
+ // Whether row will be selected by clicking on cell, false by default
61
+ triggerOnCell: false,
62
+
63
+ // treeMode: Boolean
64
+ // Whether to apply tri-state selection for child rows.
65
+ treeMode: true,
66
+
67
+ // unselectable: Object
68
+ // User can set unselectable rows in this hash object. The hash key is the row ID.
69
+ unselectable: {},
70
+
71
+ selectById: function(rowId){
72
+ // summary:
73
+ // Select rows by id.
74
+ // rowId: String...
75
+ // Row IDs
76
+ },
77
+
78
+ deselectById: function(rowId){
79
+ // summary:
80
+ // Deselect rows by id.
81
+ // rowId: String...
82
+ // Row ID
83
+ },
84
+
85
+ selectByIndex: function(rowIndex){
86
+ // summary:
87
+ // Select a row by index
88
+ // This function can also select multiple rows.
89
+ // | //Select several individual rows:
90
+ // | gridx.select.row.selectByIndex(rowIndex1, rowIndex2, rowIndex3, ...);
91
+ // | //Select a range of rows:
92
+ // | gridx.select.row.selectByIndex([rowStartIndex, rowEndIndex]);
93
+ // | //Select multiple ranges of rows:
94
+ // | gridx.select.row.selectByIndex([rowStartIndex1, rowEndIndex1], [rowStartIndex2, rowEndIndex2], ...);
95
+ // rowIndex: Integer...
96
+ // Row visual indexes
97
+ },
98
+
99
+ deSelectByIndex: function(rowIndex){
100
+ // summary:
101
+ // Deselect a row by index.
102
+ // This function can also deselect multiple rows. Please refer to selectByIndex().
103
+ // rowIndex: Integer...
104
+ // Row visual indexes
105
+ },
106
+
107
+ getSelected: function(){
108
+ // summary:
109
+ // Get id array of all selected row IDs.
110
+ },
111
+
112
+ isSelected: function(rowId){
113
+ // summary:
114
+ // Check if the given rows are all selected.
115
+ // rowId: String...
116
+ // Row IDs
117
+ // returns:
118
+ // True if all given columns are selected; false if not.
119
+ },
120
+
121
+ clear: function(){
122
+ // summary:
123
+ // Deselected all selected rows;
124
+ },
125
+
126
+ onHighlightChange: function(){
127
+ // summary:
128
+ // Fired when row highlight is changed.
129
+ // tags:
130
+ // private
131
+ }
132
+ });
133
+ =====*/
134
+
135
+ return declare(_RowCellBase, {
136
+ name: 'selectRow',
137
+
138
+ rowMixin: {
139
+ select: function(){
140
+ this.grid.select.row.selectById(this.id);
141
+ return this;
142
+ },
143
+
144
+ deselect: function(){
145
+ this.grid.select.row.deselectById(this.id);
146
+ return this;
147
+ },
148
+
149
+ isSelected: function(){
150
+ return this.model.getMark(this.id) === true;
151
+ },
152
+
153
+ isSelectable: function(){
154
+ return this.grid.select.row._isSelectable(this.id);
155
+ },
156
+
157
+ setSelectable: function(selectable){
158
+ this.grid.select.row.setSelectable(this.id, selectable);
159
+ }
160
+ },
161
+
162
+ //Public-----------------------------------------------------------------
163
+ treeMode: true,
164
+
165
+ setSelectable: function(rowId, selectable){
166
+ var t = this,
167
+ m = t.model,
168
+ n = t.grid.body.getRowNode({
169
+ rowId: rowId
170
+ });
171
+ m.setMarkable(rowId, selectable);
172
+ t.unselectable[rowId] = !selectable;
173
+ if(n){
174
+ domClass.toggle(n, 'gridxRowUnselectable', !selectable);
175
+ t.onHighlightChange({row: parseInt(n.getAttribute('visualindex'), 10)}, m.getMark(rowId));
176
+ t.onSelectionChange();
177
+ }
178
+ },
179
+
180
+ getSelected: function(){
181
+ return this.model.getMarkedIds();
182
+ },
183
+
184
+ isSelected: function(){
185
+ return array.every(arguments, function(id){
186
+ return this.model.getMark(id) === true;
187
+ }, this);
188
+ },
189
+
190
+ clear: function(silent){
191
+ query(".gridxRowSelected", this.grid.mainNode).forEach(function(node){
192
+ domClass.remove(node, 'gridxRowSelected');
193
+ node.removeAttribute('aria-selected');
194
+ });
195
+ query(".gridxRowPartialSelected", this.grid.mainNode).forEach(function(node){
196
+ domClass.remove(node, 'gridxRowPartialSelected');
197
+ });
198
+ this._clear();
199
+ this.model.clearMark();
200
+ if(!silent){
201
+ this._onSelectionChange();
202
+ }
203
+ },
204
+
205
+ onHighlightChange: function(){},
206
+
207
+ //Private---------------------------------------------------------------------
208
+ _type: 'row',
209
+
210
+ _isSelectable: function(rowId){
211
+ return !this.arg('unselectable', {})[rowId];
212
+ },
213
+
214
+ _getUnselectableRows: function(){
215
+ var ret = [],
216
+ t = this,
217
+ unselectable = this.arg('unselectable');
218
+ for(var id in unselectable){
219
+ if(unselectable[id] && t.model.byId(id)){
220
+ ret.push(id);
221
+ }
222
+ }
223
+ return ret;
224
+ },
225
+
226
+ _init: function(){
227
+ var t = this,
228
+ g = t.grid,
229
+ unselectable = t.arg('unselectable', {});
230
+ t.model.treeMarkMode('', t.arg('treeMode'));
231
+ for(var id in unselectable){
232
+ t.model.setMarkable(id, !unselectable[id]);
233
+ }
234
+ t.inherited(arguments);
235
+ //Use special types to make filtered out rows unselected
236
+ t.model._spTypes.select = 1; //1 as true
237
+ t.model.setMarkable(lang.hitch(t, t._isSelectable));
238
+ t.batchConnect(
239
+ g.rowHeader && [g.rowHeader, 'onMoveToRowHeaderCell', '_onMoveToRowHeaderCell'],
240
+ [g, 'onRowMouseDown', function(e){
241
+ if(mouse.isLeft(e) && ((t.arg('triggerOnCell') &&
242
+ !domClass.contains(e.target, 'gridxTreeExpandoIcon') &&
243
+ !domClass.contains(e.target, 'gridxTreeExpandoInner')) || !e.columnId)){
244
+ t._isOnCell = e.columnId;
245
+ if(t._isOnCell){
246
+ g.body._focusCellCol = e.columnIndex;
247
+ }
248
+ t._start({row: e.visualIndex}, g._isCopyEvent(e), e.shiftKey);
249
+ if(!e.shiftKey && !t.arg('canSwept')){
250
+ t._end();
251
+ }
252
+ }
253
+ }],
254
+ [g.body, 'onAfterRow', function(row){
255
+ var unselectable = !row.isSelectable();
256
+ domClass.toggle(row.node(), 'gridxRowUnselectable', unselectable);
257
+ }],
258
+ [g, 'onRowMouseOver', function(e){
259
+ if(t._selecting && t.arg('triggerOnCell') && e.columnId){
260
+ g.body._focusCellCol = e.columnIndex;
261
+ }
262
+ t._highlight({row: e.visualIndex});
263
+ }],
264
+ [g, has('ff') < 4 ? 'onRowKeyUp' : 'onRowKeyDown', function(e){
265
+ if(e.keyCode == keys.SPACE && (!e.columnId ||
266
+ (g._columnsById[e.columnId].rowSelectable) ||
267
+ //When trigger on cell, check if we are navigating on body, reducing the odds of conflictions.
268
+ (t.arg('triggerOnCell') && (!g.focus || g.focus.currentArea() == 'body')))){
269
+ event.stop(e);
270
+ t._isOnCell = e.columnId;
271
+ t._start({row: e.visualIndex}, g._isCopyEvent(e), e.shiftKey);
272
+ t._end();
273
+ }
274
+ }],
275
+ [g, 'setStore', '_syncMarkable']);
276
+ },
277
+
278
+ _markById: function(args, toSelect){
279
+ var m = this.model;
280
+ array.forEach(args, function(arg){
281
+ m.markById(arg, toSelect);
282
+ });
283
+ m.when();
284
+ },
285
+
286
+ _markByIndex: function(args, toSelect){
287
+ var g = this.grid,
288
+ m = this.model,
289
+ view = g.view,
290
+ rowInfo;
291
+ array.forEach(args, function(arg){
292
+ if(lang.isArrayLike(arg)){
293
+ var start = arg[0],
294
+ end = arg[1],
295
+ i, count;
296
+ if(start >= 0 && start < Infinity){
297
+ if(end >= start && end < Infinity){
298
+ count = end - start + 1;
299
+ }else{
300
+ count = view.visualCount - start;
301
+ }
302
+ rowInfo = view.getRowInfo({visualIndex: start});
303
+ start = rowInfo.rowIndex;
304
+ for(i = 0; i < count; ++i){
305
+ m.markByIndex(i + start, toSelect, '', rowInfo.parentId);
306
+ }
307
+ }
308
+ }else if(arg >= 0 && arg < Infinity){
309
+ rowInfo = view.getRowInfo({visualIndex: arg});
310
+ m.markByIndex(rowInfo.rowIndex, toSelect, '', rowInfo.parentId);
311
+ }
312
+ });
313
+ return m.when();
314
+ },
315
+
316
+ _onRender: function(start, count){
317
+ var t = this, i, end = start + count;
318
+ for(i = start; i < end; ++i){
319
+ var item = {row: i},
320
+ toHighlight = t._isSelected(item) || (t._selecting && t._toSelect &&
321
+ t._inRange(i, t._startItem.row, t._currentItem.row, 1));
322
+ if(toHighlight){
323
+ t._doHighlight(item, toHighlight);
324
+ }
325
+ }
326
+ },
327
+
328
+ _onMark: function(id, toMark, oldState, type){
329
+ if(type == 'select'){
330
+ var nodes = query('[rowid="' + this.grid._escapeId(id) + '"]', this.grid.mainNode);
331
+ if(nodes.length){
332
+ nodes.forEach(function(node){
333
+ var selected = toMark && toMark != 'mixed';
334
+ domClass.toggle(node, 'gridxRowSelected', selected);
335
+ domClass.toggle(node, 'gridxRowPartialSelected', toMark == 'mixed');
336
+ node.setAttribute('aria-selected', !!selected);
337
+ });
338
+ this.onHighlightChange({row: parseInt(nodes[0].getAttribute('visualindex'), 10)}, toMark);
339
+ }
340
+ }
341
+ },
342
+
343
+ _onMoveToCell: function(rowVisIndex, colIndex, e){
344
+ var t = this;
345
+ if(t.arg('triggerOnCell') && e.shiftKey && (e.keyCode == keys.UP_ARROW || e.keyCode == keys.DOWN_ARROW)){
346
+ t._start({row: rowVisIndex}, t.grid._isCopyEvent(e), 1); //1 as true
347
+ t._end();
348
+ }
349
+ },
350
+
351
+ _onMoveToRowHeaderCell: function(rowVisIndex, e){
352
+ if(e.shiftKey){
353
+ this._start({row: rowVisIndex}, this.grid._isCopyEvent(e), 1); //1 as true
354
+ this._end();
355
+ }
356
+ },
357
+
358
+ _isSelected: function(target){
359
+ var t = this,
360
+ id = t._getRowId(target.row);
361
+ return t._isRange ? array.indexOf(t._refSelectedIds, id) >= 0 : t.model.getMark(id);
362
+ },
363
+
364
+ _beginAutoScroll: function(){
365
+ var autoScroll = this.grid.autoScroll;
366
+ this._autoScrollH = autoScroll.horizontal;
367
+ autoScroll.horizontal = false;
368
+ },
369
+
370
+ _endAutoScroll: function(){
371
+ this.grid.autoScroll.horizontal = this._autoScrollH;
372
+ },
373
+
374
+ _doHighlight: function(target, toHighlight){
375
+ query('[visualindex="' + target.row + '"]', this.grid.mainNode).forEach(function(node){
376
+ var selected = toHighlight && toHighlight != 'mixed';
377
+ domClass.toggle(node, 'gridxRowSelected', selected);
378
+ domClass.toggle(node, 'gridxRowPartialSelected', toHighlight == 'mixed');
379
+ node.setAttribute('aria-selected', !!selected);
380
+ });
381
+ this.onHighlightChange(target, toHighlight);
382
+ },
383
+
384
+ _end: function(){
385
+ this.inherited(arguments);
386
+ delete this._isOnCell;
387
+ },
388
+
389
+ _focus: function(target){
390
+ var g = this.grid, focus = g.focus;
391
+ if(focus){
392
+ g.body._focusCellRow = target.row;
393
+ focus.focusArea(this._isOnCell ? 'body' : 'rowHeader', true);
394
+ }
395
+ },
396
+
397
+ _addToSelected: function(start, end, toSelect){
398
+ var t = this,
399
+ view = t.grid.view,
400
+ m = t.model,
401
+ lastEndItem = t._lastEndItem,
402
+ a, b, i, d;
403
+ if(!t._isRange){
404
+ t._refSelectedIds = m.getMarkedIds();
405
+ }
406
+ if(t._isRange && t._inRange(end.row, start.row, lastEndItem.row)){
407
+ a = Math.min(end.row, lastEndItem.row);
408
+ b = Math.max(end.row, lastEndItem.row);
409
+ start = view.getRowInfo({visualIndex: a}).rowIndex + 1;
410
+ end = view.getRowInfo({visualIndex: b}).rowIndex;
411
+ d = new Deferred();
412
+ m.when({
413
+ start: start,
414
+ count: end - start + 1
415
+ }, function(){
416
+ for(i = start; i <= end; ++i){
417
+ var id = m.indexToId(i),
418
+ selected = array.indexOf(t._refSelectedIds, id) >= 0;
419
+ m.markById(id, selected);
420
+ }
421
+ }).then(function(){
422
+ m.when(null, function(){
423
+ d.callback();
424
+ });
425
+ });
426
+ return d;
427
+ }else{
428
+ a = Math.min(start.row, end.row);
429
+ b = Math.max(start.row, end.row);
430
+
431
+ for(i = a; i <= b; ++i){
432
+ var rowInfo = view.getRowInfo({visualIndex: i});
433
+ m.markByIndex(rowInfo.rowIndex, toSelect, '', rowInfo.parentId);
434
+ }
435
+ return m.when();
436
+ }
437
+ },
438
+
439
+ _highlightSingle: function(target, toHighlight){ //prevent highlight at UI level if a row is not selectable
440
+ var rowId = this._getRowId(target.row);
441
+ if(!this._isSelectable(rowId)){
442
+ toHighlight = this.model.getMark(rowId);
443
+ }else{
444
+ toHighlight = toHighlight ? this._toSelect : this._isSelected(target);
445
+ }
446
+ // console.log('to highlight', toHighlight);
447
+ this._doHighlight(target, toHighlight);
448
+ },
449
+
450
+ _syncMarkable: function(){
451
+ var t = this,
452
+ unselectable = this.arg('unselectable');
453
+ for(var id in unselectable){
454
+ t.model.setMarkable(id, !unselectable[id]);
455
+ }
456
+ }
457
+ });
458
+ });
@@ -0,0 +1,244 @@
1
+ define([
2
+ "dojo/_base/declare",
3
+ "dojo/query",
4
+ "dojo/_base/connect",
5
+ "dojo/_base/Deferred",
6
+ "dojo/_base/sniff",
7
+ "dojo/_base/window",
8
+ "dojo/dom",
9
+ "dojo/keys",
10
+ "../../core/_Module",
11
+ // "dojo/NodeList-dom",
12
+ "../AutoScroll"
13
+ ], function(declare, query, connect, Deferred, has, win, dom, keys, _Module){
14
+
15
+ /*=====
16
+ return declare(_Module, {
17
+ // enabled: Boolean
18
+ // If false, this module is disabled. This parameter is mainly used by DnD to not conflict with selection operations.
19
+ enabled: true,
20
+
21
+ // canSwept: Boolean
22
+ // If false, swept selecting by mouse is disabled. Default to true.
23
+ canSwept: true,
24
+
25
+ // holdingCtrl: Boolean
26
+ // If true, when selecting it'll appear as if the CTRL key is held.
27
+ holdingCtrl: false,
28
+
29
+ // holdingShift: Boolean
30
+ // If true, when selecting it'll appear as if the SHIFT key is held.
31
+ holdingShift: false,
32
+
33
+ onSelectionChange: function(newSelectedIds, oldSelectedIds){
34
+ // summary:
35
+ // Fired when the selection is changed.
36
+ // newSelectedIds: String[]
37
+ // Current selected ids.
38
+ // oldSelectedIds: String[]
39
+ // Previous selected ids.
40
+ }
41
+ });
42
+ =====*/
43
+
44
+ return declare(_Module, {
45
+ required: ['autoScroll'],
46
+
47
+ getAPIPath: function(){
48
+ var path = {
49
+ select: {}
50
+ };
51
+ path.select[this._type] = this;
52
+ return path;
53
+ },
54
+
55
+ load: function(){
56
+ var t = this, g = t.grid, doc = win.doc;
57
+ g.domNode.setAttribute('aria-multiselectable', true);
58
+ t._refSelectedIds = [];
59
+ t.subscribe('gridClearSelection_' + g.id, function(type){
60
+ if(type != t._type){
61
+ t.clear();
62
+ }
63
+ });
64
+ t.batchConnect(
65
+ [g.body, 'onRender', '_onRender'],
66
+ [doc, 'onmouseup', '_end'],
67
+ [doc, 'onkeydown', function(e){
68
+ if(e.keyCode == keys.SHIFT){
69
+ dom.setSelectable(has('ie') > 9 ? doc.body : g.domNode, false);
70
+ }
71
+ }],
72
+ [doc, 'onkeyup', function(e){
73
+ if(e.keyCode == keys.SHIFT){
74
+ dom.setSelectable(has('ie') > 9 ? doc.body : g.domNode, true);
75
+ }
76
+ }]
77
+ );
78
+ t._init();
79
+ t.loaded.callback();
80
+ },
81
+
82
+ //Public ------------------------------------------------------------------
83
+ enabled: true,
84
+
85
+ canSwept: true,
86
+
87
+ holdingCtrl: false,
88
+
89
+ holdingShift: false,
90
+
91
+ selectById: function(/* id */){
92
+ return this._subMark('_markById', arguments, true);
93
+ },
94
+
95
+ deselectById: function(/* id */){
96
+ return this._subMark('_markById', arguments, false);
97
+ },
98
+
99
+ selectByIndex: function(/* start, end */){
100
+ return this._subMark('_markByIndex', arguments, true);
101
+ },
102
+
103
+ deselectByIndex: function(/* start, end */){
104
+ return this._subMark('_markByIndex', arguments, false);
105
+ },
106
+
107
+ onSelectionChange: function(/*newSelectedIds, oldSelectedIds*/){
108
+ // summary:
109
+ // Event: fired when the selection is changed.
110
+ },
111
+
112
+ //Private -----------------------------------------------------------------
113
+ _clear: function(){
114
+ var t = this;
115
+ delete t._lastToSelect;
116
+ delete t._lastStartItem;
117
+ delete t._lastEndItem;
118
+ },
119
+
120
+ _subMark: function(func, args, toSelect){
121
+ var t = this;
122
+ if(t.arg('enabled')){
123
+ if(toSelect){
124
+ connect.publish('gridClearSelection_' + t.grid.id, [t._type]);
125
+ }
126
+ t._lastSelectedIds = t.getSelected();
127
+ t._refSelectedIds = [];
128
+ return Deferred.when(t[func](args, toSelect), function(){
129
+ t._onSelectionChange();
130
+ });
131
+ }
132
+ },
133
+
134
+ _start: function(item, extending, isRange){
135
+ var t = this;
136
+ if(!t._selecting && !t._marking && t.arg('enabled')){
137
+ dom.setSelectable(t.grid.domNode, false);
138
+ t._fixFF(1);
139
+ var isSelected = t._isSelected(item);
140
+ isRange = isRange || t.arg('holdingShift');
141
+ if(isRange && t._lastStartItem){
142
+ t._isRange = 1; //1 as true
143
+ t._toSelect = t._lastToSelect;
144
+ t._startItem = t._lastStartItem;
145
+ t._currentItem = t._lastEndItem;
146
+ }else{
147
+ t._startItem = item;
148
+ t._currentItem = null;
149
+ if(extending || t.arg('holdingCtrl')){
150
+ t._toSelect = !isSelected;
151
+ }else{
152
+ t._toSelect = 1; //1 as true
153
+ t.clear(1);
154
+ }
155
+ }
156
+ connect.publish('gridClearSelection_' + t.grid.id, [t._type]);
157
+ t._beginAutoScroll();
158
+ t.grid.autoScroll.enabled = true;
159
+ t._lastSelectedIds = t.getSelected();
160
+ t._selecting = 1; //1 as true
161
+ t._highlight(item);
162
+ }
163
+ },
164
+
165
+ _highlight: function(target){
166
+ var t = this;
167
+ if(t._selecting){
168
+ var type = t._type,
169
+ start = t._startItem,
170
+ current = t._currentItem,
171
+ highlight = function(from, to, toHL){
172
+ from = from[type];
173
+ to = to[type];
174
+ var dir = from < to ? 1 : -1;
175
+ for(; from != to; from += dir){
176
+ var item = {};
177
+ item[type] = from;
178
+ t._highlightSingle(item, toHL);
179
+ }
180
+ };
181
+ if(current === null){
182
+ //First time select.
183
+ t._highlightSingle(target, 1); //1 as true
184
+ }else{
185
+ if(t._inRange(target[type], start[type], current[type])){
186
+ //target is between start and current, some selected should be deselected.
187
+ highlight(current, target, 0); //0 as false
188
+ }else{
189
+ if(t._inRange(start[type], target[type], current[type])){
190
+ //selection has jumped to different direction, all should be deselected.
191
+ highlight(current, start, 0); //0 as false
192
+ current = start;
193
+ }
194
+ highlight(target, current, 1); //1 as true
195
+ }
196
+ }
197
+ t._currentItem = target;
198
+ t._focus(target);
199
+ }
200
+ },
201
+
202
+ _end: function(){
203
+ var t = this, g = t.grid;
204
+ if(t._selecting){
205
+ t._fixFF();
206
+ t._endAutoScroll();
207
+ t._selecting = 0; //0 as false
208
+ t._marking = 1; //1 as true
209
+ g.autoScroll.enabled = false;
210
+ var d = t._addToSelected(t._startItem, t._currentItem, t._toSelect);
211
+ t._lastToSelect = t._toSelect;
212
+ t._lastStartItem = t._startItem;
213
+ t._lastEndItem = t._currentItem;
214
+ t._startItem = t._currentItem = t._isRange = null;
215
+ Deferred.when(d, function(){
216
+ dom.setSelectable(g.domNode, true);
217
+ t._marking = 0; //0 as false
218
+ t._onSelectionChange();
219
+ });
220
+ }
221
+ },
222
+
223
+ _highlightSingle: function(target, toHighlight){
224
+ toHighlight = toHighlight ? this._toSelect : this._isSelected(target);
225
+ this._doHighlight(target, toHighlight);
226
+ },
227
+
228
+ _onSelectionChange: function(){
229
+ var t = this, selectedIds = t.getSelected();
230
+ t.onSelectionChange(selectedIds, t._lastSelectedIds);
231
+ t._lastSelectedIds = selectedIds;
232
+ },
233
+
234
+ _inRange: function(value, start, end, isClose){
235
+ return ((value >= start && value <= end) || (value >= end && value <= start)) && (isClose || value != end);
236
+ },
237
+
238
+ _fixFF: function(isStart){
239
+ if(has('ff')){
240
+ query('.gridxSortNode', this.grid.headerNode).style('overflow', isStart ? 'visible' : '');
241
+ }
242
+ }
243
+ });
244
+ });