extjs-rails 4.1.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (517) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +36 -0
  4. data/README.md +29 -0
  5. data/Rakefile +2 -0
  6. data/app/assets/javascripts/extjs-rails/extjs-rails.js +1 -0
  7. data/app/assets/javascripts/extjs-rails/index.js.erb +9 -0
  8. data/app/assets/javascripts/extjs-rails/sdk.jsb3 +2017 -0
  9. data/app/assets/javascripts/extjs-rails/src/AbstractComponent.js +3290 -0
  10. data/app/assets/javascripts/extjs-rails/src/AbstractManager.js +144 -0
  11. data/app/assets/javascripts/extjs-rails/src/AbstractPlugin.js +72 -0
  12. data/app/assets/javascripts/extjs-rails/src/Action.js +276 -0
  13. data/app/assets/javascripts/extjs-rails/src/Ajax.js +99 -0
  14. data/app/assets/javascripts/extjs-rails/src/Component.js +1344 -0
  15. data/app/assets/javascripts/extjs-rails/src/ComponentLoader.js +202 -0
  16. data/app/assets/javascripts/extjs-rails/src/ComponentManager.js +47 -0
  17. data/app/assets/javascripts/extjs-rails/src/ComponentQuery.js +521 -0
  18. data/app/assets/javascripts/extjs-rails/src/Editor.js +494 -0
  19. data/app/assets/javascripts/extjs-rails/src/ElementLoader.js +404 -0
  20. data/app/assets/javascripts/extjs-rails/src/FocusManager.js +712 -0
  21. data/app/assets/javascripts/extjs-rails/src/Img.js +111 -0
  22. data/app/assets/javascripts/extjs-rails/src/Layer.js +543 -0
  23. data/app/assets/javascripts/extjs-rails/src/LoadMask.js +432 -0
  24. data/app/assets/javascripts/extjs-rails/src/ModelManager.js +186 -0
  25. data/app/assets/javascripts/extjs-rails/src/PluginManager.js +110 -0
  26. data/app/assets/javascripts/extjs-rails/src/ProgressBar.js +336 -0
  27. data/app/assets/javascripts/extjs-rails/src/Shadow.js +233 -0
  28. data/app/assets/javascripts/extjs-rails/src/ShadowPool.js +43 -0
  29. data/app/assets/javascripts/extjs-rails/src/Template.js +331 -0
  30. data/app/assets/javascripts/extjs-rails/src/XTemplate.js +365 -0
  31. data/app/assets/javascripts/extjs-rails/src/XTemplateCompiler.js +450 -0
  32. data/app/assets/javascripts/extjs-rails/src/XTemplateParser.js +249 -0
  33. data/app/assets/javascripts/extjs-rails/src/ZIndexManager.js +519 -0
  34. data/app/assets/javascripts/extjs-rails/src/app/Application.js +271 -0
  35. data/app/assets/javascripts/extjs-rails/src/app/Controller.js +458 -0
  36. data/app/assets/javascripts/extjs-rails/src/app/EventBus.js +112 -0
  37. data/app/assets/javascripts/extjs-rails/src/button/Button.js +1483 -0
  38. data/app/assets/javascripts/extjs-rails/src/button/Cycle.js +215 -0
  39. data/app/assets/javascripts/extjs-rails/src/button/Split.js +99 -0
  40. data/app/assets/javascripts/extjs-rails/src/chart/Callout.js +140 -0
  41. data/app/assets/javascripts/extjs-rails/src/chart/Chart.js +966 -0
  42. data/app/assets/javascripts/extjs-rails/src/chart/Highlight.js +172 -0
  43. data/app/assets/javascripts/extjs-rails/src/chart/Label.js +241 -0
  44. data/app/assets/javascripts/extjs-rails/src/chart/Legend.js +474 -0
  45. data/app/assets/javascripts/extjs-rails/src/chart/LegendItem.js +217 -0
  46. data/app/assets/javascripts/extjs-rails/src/chart/Mask.js +230 -0
  47. data/app/assets/javascripts/extjs-rails/src/chart/MaskLayer.js +48 -0
  48. data/app/assets/javascripts/extjs-rails/src/chart/Navigation.js +79 -0
  49. data/app/assets/javascripts/extjs-rails/src/chart/Shape.js +106 -0
  50. data/app/assets/javascripts/extjs-rails/src/chart/Tip.js +98 -0
  51. data/app/assets/javascripts/extjs-rails/src/chart/TipSurface.js +42 -0
  52. data/app/assets/javascripts/extjs-rails/src/chart/axis/Abstract.js +73 -0
  53. data/app/assets/javascripts/extjs-rails/src/chart/axis/Axis.js +961 -0
  54. data/app/assets/javascripts/extjs-rails/src/chart/axis/Category.js +130 -0
  55. data/app/assets/javascripts/extjs-rails/src/chart/axis/Gauge.js +203 -0
  56. data/app/assets/javascripts/extjs-rails/src/chart/axis/Numeric.js +235 -0
  57. data/app/assets/javascripts/extjs-rails/src/chart/axis/Radial.js +204 -0
  58. data/app/assets/javascripts/extjs-rails/src/chart/axis/Time.js +135 -0
  59. data/app/assets/javascripts/extjs-rails/src/chart/series/Area.js +803 -0
  60. data/app/assets/javascripts/extjs-rails/src/chart/series/Bar.js +853 -0
  61. data/app/assets/javascripts/extjs-rails/src/chart/series/Cartesian.js +328 -0
  62. data/app/assets/javascripts/extjs-rails/src/chart/series/Column.js +104 -0
  63. data/app/assets/javascripts/extjs-rails/src/chart/series/Gauge.js +490 -0
  64. data/app/assets/javascripts/extjs-rails/src/chart/series/Line.js +1104 -0
  65. data/app/assets/javascripts/extjs-rails/src/chart/series/Pie.js +1072 -0
  66. data/app/assets/javascripts/extjs-rails/src/chart/series/Radar.js +440 -0
  67. data/app/assets/javascripts/extjs-rails/src/chart/series/Scatter.js +668 -0
  68. data/app/assets/javascripts/extjs-rails/src/chart/series/Series.js +443 -0
  69. data/app/assets/javascripts/extjs-rails/src/chart/theme/Base.js +175 -0
  70. data/app/assets/javascripts/extjs-rails/src/chart/theme/Theme.js +253 -0
  71. data/app/assets/javascripts/extjs-rails/src/container/AbstractContainer.js +1062 -0
  72. data/app/assets/javascripts/extjs-rails/src/container/ButtonGroup.js +143 -0
  73. data/app/assets/javascripts/extjs-rails/src/container/Container.js +212 -0
  74. data/app/assets/javascripts/extjs-rails/src/container/DockingContainer.js +265 -0
  75. data/app/assets/javascripts/extjs-rails/src/container/Viewport.js +184 -0
  76. data/app/assets/javascripts/extjs-rails/src/core/dom/Element.form.js +50 -0
  77. data/app/assets/javascripts/extjs-rails/src/core/dom/Element.static-more.js +159 -0
  78. data/app/assets/javascripts/extjs-rails/src/core/examples/index.html +321 -0
  79. data/app/assets/javascripts/extjs-rails/src/core/examples/index.js +6 -0
  80. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CTO.js +25 -0
  81. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CoolGuy.js +20 -0
  82. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Developer.js +43 -0
  83. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Gun.js +3 -0
  84. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/HumanResource.js +23 -0
  85. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Musician.js +20 -0
  86. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Person.js +50 -0
  87. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanComposeSongs.js +9 -0
  88. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanPlayGuitar.js +9 -0
  89. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanSing.js +18 -0
  90. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/A.js +3 -0
  91. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/B.js +3 -0
  92. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/C.js +3 -0
  93. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/D.js +3 -0
  94. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/E.js +3 -0
  95. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/A.js +3 -0
  96. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/B.js +4 -0
  97. data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/C.js +3 -0
  98. data/app/assets/javascripts/extjs-rails/src/core/src/EventManager.js +1167 -0
  99. data/app/assets/javascripts/extjs-rails/src/core/src/EventObject.js +883 -0
  100. data/app/assets/javascripts/extjs-rails/src/core/src/Ext-more.js +1283 -0
  101. data/app/assets/javascripts/extjs-rails/src/core/src/Ext.js +736 -0
  102. data/app/assets/javascripts/extjs-rails/src/core/src/Support.js +662 -0
  103. data/app/assets/javascripts/extjs-rails/src/core/src/class/Base.js +1085 -0
  104. data/app/assets/javascripts/extjs-rails/src/core/src/class/Class.js +676 -0
  105. data/app/assets/javascripts/extjs-rails/src/core/src/class/ClassManager.js +1591 -0
  106. data/app/assets/javascripts/extjs-rails/src/core/src/class/Loader.js +1423 -0
  107. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.alignment.js +173 -0
  108. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.insertion.js +193 -0
  109. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.js +681 -0
  110. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.position.js +356 -0
  111. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.static.js +474 -0
  112. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.style.js +851 -0
  113. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.traversal.js +180 -0
  114. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractHelper.js +291 -0
  115. data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractQuery.js +72 -0
  116. data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElement.js +75 -0
  117. data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElementLite.js +436 -0
  118. data/app/assets/javascripts/extjs-rails/src/core/src/dom/DomQuery-aria.js +1049 -0
  119. data/app/assets/javascripts/extjs-rails/src/core/src/env/Browser.js +186 -0
  120. data/app/assets/javascripts/extjs-rails/src/core/src/env/FeatureDetector.js +274 -0
  121. data/app/assets/javascripts/extjs-rails/src/core/src/env/OS.js +141 -0
  122. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Array.js +1205 -0
  123. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Date.js +1463 -0
  124. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Error.js +326 -0
  125. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Function.js +485 -0
  126. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Number.js +175 -0
  127. data/app/assets/javascripts/extjs-rails/src/core/src/lang/Object.js +606 -0
  128. data/app/assets/javascripts/extjs-rails/src/core/src/lang/String.js +333 -0
  129. data/app/assets/javascripts/extjs-rails/src/core/src/misc/JSON.js +236 -0
  130. data/app/assets/javascripts/extjs-rails/src/core/src/perf/Accumulator.js +244 -0
  131. data/app/assets/javascripts/extjs-rails/src/core/src/perf/Monitor.js +197 -0
  132. data/app/assets/javascripts/extjs-rails/src/core/src/util/DelayedTask.js +71 -0
  133. data/app/assets/javascripts/extjs-rails/src/core/src/util/Event.js +215 -0
  134. data/app/assets/javascripts/extjs-rails/src/core/src/util/Format.js +551 -0
  135. data/app/assets/javascripts/extjs-rails/src/core/src/util/TaskManager.js +417 -0
  136. data/app/assets/javascripts/extjs-rails/src/core/src/version/Version.js +364 -0
  137. data/app/assets/javascripts/extjs-rails/src/core/test/unit/README.MD +91 -0
  138. data/app/assets/javascripts/extjs-rails/src/core/test/unit/bootstrap.js +39 -0
  139. data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build-data.js +34 -0
  140. data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build.sh +2 -0
  141. data/app/assets/javascripts/extjs-rails/src/core/test/unit/data.js +27 -0
  142. data/app/assets/javascripts/extjs-rails/src/core/test/unit/index.html +15 -0
  143. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom.html +40 -0
  144. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/extjs-api.js +12 -0
  145. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/platform-api.js +134 -0
  146. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/sanity.js +4 -0
  147. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api-out.js +128 -0
  148. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api.js +89 -0
  149. data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/env/Environment.js +357 -0
  150. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/APITest.js +37 -0
  151. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/jsb3.js +14 -0
  152. data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/test-setup.js +137 -0
  153. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/EventManager.js +629 -0
  154. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-mess.backup +198 -0
  155. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-more.js +520 -0
  156. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext.js +1550 -0
  157. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Support.js +250 -0
  158. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Base.js +47 -0
  159. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Class.js +561 -0
  160. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/ClassManager.js +555 -0
  161. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/CompositeElementLite.js +409 -0
  162. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/DomHelper.js +444 -0
  163. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.insertion.js +342 -0
  164. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.js +731 -0
  165. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.static.js +201 -0
  166. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.style.js +118 -0
  167. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.traversal.js +336 -0
  168. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Array.js +1229 -0
  169. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Date.js +697 -0
  170. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Error.js +277 -0
  171. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Function.js +536 -0
  172. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Number.js +323 -0
  173. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Object.js +591 -0
  174. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/String.js +451 -0
  175. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/misc/JSON.js +252 -0
  176. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/util/Format.js +521 -0
  177. data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/version/Version.js +148 -0
  178. data/app/assets/javascripts/extjs-rails/src/core/test/unit/specs.html +19 -0
  179. data/app/assets/javascripts/extjs-rails/src/data/AbstractStore.js +887 -0
  180. data/app/assets/javascripts/extjs-rails/src/data/ArrayStore.js +74 -0
  181. data/app/assets/javascripts/extjs-rails/src/data/Batch.js +236 -0
  182. data/app/assets/javascripts/extjs-rails/src/data/BufferStore.js +13 -0
  183. data/app/assets/javascripts/extjs-rails/src/data/Connection.js +969 -0
  184. data/app/assets/javascripts/extjs-rails/src/data/DirectStore.js +50 -0
  185. data/app/assets/javascripts/extjs-rails/src/data/Errors.js +52 -0
  186. data/app/assets/javascripts/extjs-rails/src/data/Field.js +341 -0
  187. data/app/assets/javascripts/extjs-rails/src/data/IdGenerator.js +198 -0
  188. data/app/assets/javascripts/extjs-rails/src/data/JsonP.js +253 -0
  189. data/app/assets/javascripts/extjs-rails/src/data/JsonPStore.js +51 -0
  190. data/app/assets/javascripts/extjs-rails/src/data/JsonStore.js +60 -0
  191. data/app/assets/javascripts/extjs-rails/src/data/Model.js +1673 -0
  192. data/app/assets/javascripts/extjs-rails/src/data/NodeInterface.js +1294 -0
  193. data/app/assets/javascripts/extjs-rails/src/data/NodeStore.js +254 -0
  194. data/app/assets/javascripts/extjs-rails/src/data/Operation.js +331 -0
  195. data/app/assets/javascripts/extjs-rails/src/data/Request.js +40 -0
  196. data/app/assets/javascripts/extjs-rails/src/data/ResultSet.js +56 -0
  197. data/app/assets/javascripts/extjs-rails/src/data/SequentialIdGenerator.js +61 -0
  198. data/app/assets/javascripts/extjs-rails/src/data/SortTypes.js +125 -0
  199. data/app/assets/javascripts/extjs-rails/src/data/Store.js +2609 -0
  200. data/app/assets/javascripts/extjs-rails/src/data/StoreManager.js +156 -0
  201. data/app/assets/javascripts/extjs-rails/src/data/Tree.js +290 -0
  202. data/app/assets/javascripts/extjs-rails/src/data/TreeStore.js +655 -0
  203. data/app/assets/javascripts/extjs-rails/src/data/Types.js +190 -0
  204. data/app/assets/javascripts/extjs-rails/src/data/UuidGenerator.js +215 -0
  205. data/app/assets/javascripts/extjs-rails/src/data/XmlStore.js +76 -0
  206. data/app/assets/javascripts/extjs-rails/src/data/association/Association.js +243 -0
  207. data/app/assets/javascripts/extjs-rails/src/data/association/BelongsTo.js +291 -0
  208. data/app/assets/javascripts/extjs-rails/src/data/association/HasMany.js +289 -0
  209. data/app/assets/javascripts/extjs-rails/src/data/association/HasOne.js +304 -0
  210. data/app/assets/javascripts/extjs-rails/src/data/proxy/Ajax.js +282 -0
  211. data/app/assets/javascripts/extjs-rails/src/data/proxy/Client.js +21 -0
  212. data/app/assets/javascripts/extjs-rails/src/data/proxy/Direct.js +181 -0
  213. data/app/assets/javascripts/extjs-rails/src/data/proxy/JsonP.js +313 -0
  214. data/app/assets/javascripts/extjs-rails/src/data/proxy/LocalStorage.js +69 -0
  215. data/app/assets/javascripts/extjs-rails/src/data/proxy/Memory.js +156 -0
  216. data/app/assets/javascripts/extjs-rails/src/data/proxy/Proxy.js +433 -0
  217. data/app/assets/javascripts/extjs-rails/src/data/proxy/Rest.js +173 -0
  218. data/app/assets/javascripts/extjs-rails/src/data/proxy/Server.js +460 -0
  219. data/app/assets/javascripts/extjs-rails/src/data/proxy/SessionStorage.js +39 -0
  220. data/app/assets/javascripts/extjs-rails/src/data/proxy/WebStorage.js +546 -0
  221. data/app/assets/javascripts/extjs-rails/src/data/reader/Array.js +68 -0
  222. data/app/assets/javascripts/extjs-rails/src/data/reader/Json.js +383 -0
  223. data/app/assets/javascripts/extjs-rails/src/data/reader/Reader.js +735 -0
  224. data/app/assets/javascripts/extjs-rails/src/data/reader/Xml.js +292 -0
  225. data/app/assets/javascripts/extjs-rails/src/data/validations.js +149 -0
  226. data/app/assets/javascripts/extjs-rails/src/data/writer/Json.js +81 -0
  227. data/app/assets/javascripts/extjs-rails/src/data/writer/Writer.js +147 -0
  228. data/app/assets/javascripts/extjs-rails/src/data/writer/Xml.js +88 -0
  229. data/app/assets/javascripts/extjs-rails/src/dd/DD.js +300 -0
  230. data/app/assets/javascripts/extjs-rails/src/dd/DDProxy.js +204 -0
  231. data/app/assets/javascripts/extjs-rails/src/dd/DDTarget.js +171 -0
  232. data/app/assets/javascripts/extjs-rails/src/dd/DragDrop.js +1101 -0
  233. data/app/assets/javascripts/extjs-rails/src/dd/DragDropManager.js +1264 -0
  234. data/app/assets/javascripts/extjs-rails/src/dd/DragSource.js +392 -0
  235. data/app/assets/javascripts/extjs-rails/src/dd/DragTracker.js +562 -0
  236. data/app/assets/javascripts/extjs-rails/src/dd/DragZone.js +137 -0
  237. data/app/assets/javascripts/extjs-rails/src/dd/DropTarget.js +118 -0
  238. data/app/assets/javascripts/extjs-rails/src/dd/DropZone.js +254 -0
  239. data/app/assets/javascripts/extjs-rails/src/dd/Registry.js +117 -0
  240. data/app/assets/javascripts/extjs-rails/src/dd/ScrollManager.js +218 -0
  241. data/app/assets/javascripts/extjs-rails/src/dd/StatusProxy.js +179 -0
  242. data/app/assets/javascripts/extjs-rails/src/diag/layout/Context.js +523 -0
  243. data/app/assets/javascripts/extjs-rails/src/diag/layout/ContextItem.js +179 -0
  244. data/app/assets/javascripts/extjs-rails/src/direct/Event.js +35 -0
  245. data/app/assets/javascripts/extjs-rails/src/direct/ExceptionEvent.js +16 -0
  246. data/app/assets/javascripts/extjs-rails/src/direct/JsonProvider.js +82 -0
  247. data/app/assets/javascripts/extjs-rails/src/direct/Manager.js +263 -0
  248. data/app/assets/javascripts/extjs-rails/src/direct/PollingProvider.js +156 -0
  249. data/app/assets/javascripts/extjs-rails/src/direct/Provider.js +96 -0
  250. data/app/assets/javascripts/extjs-rails/src/direct/RemotingEvent.js +24 -0
  251. data/app/assets/javascripts/extjs-rails/src/direct/RemotingMethod.js +100 -0
  252. data/app/assets/javascripts/extjs-rails/src/direct/RemotingProvider.js +510 -0
  253. data/app/assets/javascripts/extjs-rails/src/direct/Transaction.js +41 -0
  254. data/app/assets/javascripts/extjs-rails/src/dom/Element.alignment.js +378 -0
  255. data/app/assets/javascripts/extjs-rails/src/dom/Element.anim.js +962 -0
  256. data/app/assets/javascripts/extjs-rails/src/dom/Element.dd.js +40 -0
  257. data/app/assets/javascripts/extjs-rails/src/dom/Element.fx.js +194 -0
  258. data/app/assets/javascripts/extjs-rails/src/dom/Element.js +1407 -0
  259. data/app/assets/javascripts/extjs-rails/src/dom/Element.position.js +501 -0
  260. data/app/assets/javascripts/extjs-rails/src/dom/Element.scroll.js +214 -0
  261. data/app/assets/javascripts/extjs-rails/src/dom/Element.style.js +792 -0
  262. data/app/assets/javascripts/extjs-rails/src/dom/Element.traversal.js +8 -0
  263. data/app/assets/javascripts/extjs-rails/src/dom/Helper.js +466 -0
  264. data/app/assets/javascripts/extjs-rails/src/dom/Query.js +1067 -0
  265. data/app/assets/javascripts/extjs-rails/src/draw/Color.js +303 -0
  266. data/app/assets/javascripts/extjs-rails/src/draw/Component.js +245 -0
  267. data/app/assets/javascripts/extjs-rails/src/draw/CompositeSprite.js +299 -0
  268. data/app/assets/javascripts/extjs-rails/src/draw/Draw.js +1217 -0
  269. data/app/assets/javascripts/extjs-rails/src/draw/Matrix.js +183 -0
  270. data/app/assets/javascripts/extjs-rails/src/draw/Sprite.js +554 -0
  271. data/app/assets/javascripts/extjs-rails/src/draw/SpriteDD.js +87 -0
  272. data/app/assets/javascripts/extjs-rails/src/draw/Surface.js +1001 -0
  273. data/app/assets/javascripts/extjs-rails/src/draw/Text.js +175 -0
  274. data/app/assets/javascripts/extjs-rails/src/draw/engine/ImageExporter.js +106 -0
  275. data/app/assets/javascripts/extjs-rails/src/draw/engine/Svg.js +734 -0
  276. data/app/assets/javascripts/extjs-rails/src/draw/engine/SvgExporter.js +280 -0
  277. data/app/assets/javascripts/extjs-rails/src/draw/engine/Vml.js +916 -0
  278. data/app/assets/javascripts/extjs-rails/src/flash/Component.js +248 -0
  279. data/app/assets/javascripts/extjs-rails/src/form/Basic.js +1018 -0
  280. data/app/assets/javascripts/extjs-rails/src/form/CheckboxGroup.js +441 -0
  281. data/app/assets/javascripts/extjs-rails/src/form/CheckboxManager.js +26 -0
  282. data/app/assets/javascripts/extjs-rails/src/form/FieldAncestor.js +210 -0
  283. data/app/assets/javascripts/extjs-rails/src/form/FieldContainer.js +290 -0
  284. data/app/assets/javascripts/extjs-rails/src/form/FieldSet.js +506 -0
  285. data/app/assets/javascripts/extjs-rails/src/form/Label.js +110 -0
  286. data/app/assets/javascripts/extjs-rails/src/form/Labelable.js +764 -0
  287. data/app/assets/javascripts/extjs-rails/src/form/Panel.js +335 -0
  288. data/app/assets/javascripts/extjs-rails/src/form/RadioGroup.js +124 -0
  289. data/app/assets/javascripts/extjs-rails/src/form/RadioManager.js +26 -0
  290. data/app/assets/javascripts/extjs-rails/src/form/action/Action.js +307 -0
  291. data/app/assets/javascripts/extjs-rails/src/form/action/DirectLoad.js +107 -0
  292. data/app/assets/javascripts/extjs-rails/src/form/action/DirectSubmit.js +119 -0
  293. data/app/assets/javascripts/extjs-rails/src/form/action/Load.js +120 -0
  294. data/app/assets/javascripts/extjs-rails/src/form/action/StandardSubmit.js +34 -0
  295. data/app/assets/javascripts/extjs-rails/src/form/action/Submit.js +257 -0
  296. data/app/assets/javascripts/extjs-rails/src/form/field/Base.js +813 -0
  297. data/app/assets/javascripts/extjs-rails/src/form/field/Checkbox.js +505 -0
  298. data/app/assets/javascripts/extjs-rails/src/form/field/ComboBox.js +1427 -0
  299. data/app/assets/javascripts/extjs-rails/src/form/field/Date.js +578 -0
  300. data/app/assets/javascripts/extjs-rails/src/form/field/Display.js +155 -0
  301. data/app/assets/javascripts/extjs-rails/src/form/field/Field.js +430 -0
  302. data/app/assets/javascripts/extjs-rails/src/form/field/File.js +265 -0
  303. data/app/assets/javascripts/extjs-rails/src/form/field/Hidden.js +75 -0
  304. data/app/assets/javascripts/extjs-rails/src/form/field/HtmlEditor.js +1439 -0
  305. data/app/assets/javascripts/extjs-rails/src/form/field/Number.js +380 -0
  306. data/app/assets/javascripts/extjs-rails/src/form/field/Picker.js +321 -0
  307. data/app/assets/javascripts/extjs-rails/src/form/field/Radio.js +279 -0
  308. data/app/assets/javascripts/extjs-rails/src/form/field/Spinner.js +321 -0
  309. data/app/assets/javascripts/extjs-rails/src/form/field/Text.js +727 -0
  310. data/app/assets/javascripts/extjs-rails/src/form/field/TextArea.js +228 -0
  311. data/app/assets/javascripts/extjs-rails/src/form/field/Time.js +459 -0
  312. data/app/assets/javascripts/extjs-rails/src/form/field/Trigger.js +469 -0
  313. data/app/assets/javascripts/extjs-rails/src/form/field/VTypes.js +172 -0
  314. data/app/assets/javascripts/extjs-rails/src/fx/Anim.js +472 -0
  315. data/app/assets/javascripts/extjs-rails/src/fx/Animator.js +410 -0
  316. data/app/assets/javascripts/extjs-rails/src/fx/CubicBezier.js +77 -0
  317. data/app/assets/javascripts/extjs-rails/src/fx/Easing.js +136 -0
  318. data/app/assets/javascripts/extjs-rails/src/fx/Manager.js +353 -0
  319. data/app/assets/javascripts/extjs-rails/src/fx/PropertyHandler.js +381 -0
  320. data/app/assets/javascripts/extjs-rails/src/fx/Queue.js +123 -0
  321. data/app/assets/javascripts/extjs-rails/src/fx/target/Component.js +118 -0
  322. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElement.js +46 -0
  323. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElementCSS.js +22 -0
  324. data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeSprite.js +34 -0
  325. data/app/assets/javascripts/extjs-rails/src/fx/target/Element.js +83 -0
  326. data/app/assets/javascripts/extjs-rails/src/fx/target/ElementCSS.js +77 -0
  327. data/app/assets/javascripts/extjs-rails/src/fx/target/Sprite.js +128 -0
  328. data/app/assets/javascripts/extjs-rails/src/fx/target/Target.js +36 -0
  329. data/app/assets/javascripts/extjs-rails/src/grid/CellEditor.js +172 -0
  330. data/app/assets/javascripts/extjs-rails/src/grid/ColumnComponentLayout.js +34 -0
  331. data/app/assets/javascripts/extjs-rails/src/grid/ColumnLayout.js +201 -0
  332. data/app/assets/javascripts/extjs-rails/src/grid/Lockable.js +863 -0
  333. data/app/assets/javascripts/extjs-rails/src/grid/LockingView.js +169 -0
  334. data/app/assets/javascripts/extjs-rails/src/grid/PagingScroller.js +539 -0
  335. data/app/assets/javascripts/extjs-rails/src/grid/Panel.js +393 -0
  336. data/app/assets/javascripts/extjs-rails/src/grid/RowEditor.js +731 -0
  337. data/app/assets/javascripts/extjs-rails/src/grid/RowNumberer.js +76 -0
  338. data/app/assets/javascripts/extjs-rails/src/grid/Scroller.js +5 -0
  339. data/app/assets/javascripts/extjs-rails/src/grid/View.js +44 -0
  340. data/app/assets/javascripts/extjs-rails/src/grid/ViewDropZone.js +41 -0
  341. data/app/assets/javascripts/extjs-rails/src/grid/column/Action.js +318 -0
  342. data/app/assets/javascripts/extjs-rails/src/grid/column/Boolean.js +82 -0
  343. data/app/assets/javascripts/extjs-rails/src/grid/column/Column.js +835 -0
  344. data/app/assets/javascripts/extjs-rails/src/grid/column/Date.js +63 -0
  345. data/app/assets/javascripts/extjs-rails/src/grid/column/Number.js +52 -0
  346. data/app/assets/javascripts/extjs-rails/src/grid/column/Template.js +58 -0
  347. data/app/assets/javascripts/extjs-rails/src/grid/feature/AbstractSummary.js +154 -0
  348. data/app/assets/javascripts/extjs-rails/src/grid/feature/Chunking.js +77 -0
  349. data/app/assets/javascripts/extjs-rails/src/grid/feature/Feature.js +158 -0
  350. data/app/assets/javascripts/extjs-rails/src/grid/feature/Grouping.js +822 -0
  351. data/app/assets/javascripts/extjs-rails/src/grid/feature/GroupingSummary.js +243 -0
  352. data/app/assets/javascripts/extjs-rails/src/grid/feature/RowBody.js +116 -0
  353. data/app/assets/javascripts/extjs-rails/src/grid/feature/RowWrap.js +120 -0
  354. data/app/assets/javascripts/extjs-rails/src/grid/feature/Summary.js +167 -0
  355. data/app/assets/javascripts/extjs-rails/src/grid/header/Container.js +965 -0
  356. data/app/assets/javascripts/extjs-rails/src/grid/header/DragZone.js +69 -0
  357. data/app/assets/javascripts/extjs-rails/src/grid/header/DropZone.js +265 -0
  358. data/app/assets/javascripts/extjs-rails/src/grid/plugin/CellEditing.js +453 -0
  359. data/app/assets/javascripts/extjs-rails/src/grid/plugin/DragDrop.js +254 -0
  360. data/app/assets/javascripts/extjs-rails/src/grid/plugin/Editing.js +561 -0
  361. data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderReorderer.js +49 -0
  362. data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderResizer.js +292 -0
  363. data/app/assets/javascripts/extjs-rails/src/grid/plugin/RowEditing.js +339 -0
  364. data/app/assets/javascripts/extjs-rails/src/grid/property/Grid.js +351 -0
  365. data/app/assets/javascripts/extjs-rails/src/grid/property/HeaderContainer.js +109 -0
  366. data/app/assets/javascripts/extjs-rails/src/grid/property/Property.js +36 -0
  367. data/app/assets/javascripts/extjs-rails/src/grid/property/Store.js +141 -0
  368. data/app/assets/javascripts/extjs-rails/src/layout/ClassList.js +90 -0
  369. data/app/assets/javascripts/extjs-rails/src/layout/Context.js +1232 -0
  370. data/app/assets/javascripts/extjs-rails/src/layout/ContextItem.js +1470 -0
  371. data/app/assets/javascripts/extjs-rails/src/layout/Layout.js +761 -0
  372. data/app/assets/javascripts/extjs-rails/src/layout/component/Auto.js +220 -0
  373. data/app/assets/javascripts/extjs-rails/src/layout/component/Body.js +80 -0
  374. data/app/assets/javascripts/extjs-rails/src/layout/component/BoundList.js +95 -0
  375. data/app/assets/javascripts/extjs-rails/src/layout/component/Button.js +261 -0
  376. data/app/assets/javascripts/extjs-rails/src/layout/component/Component.js +427 -0
  377. data/app/assets/javascripts/extjs-rails/src/layout/component/Dock.js +1132 -0
  378. data/app/assets/javascripts/extjs-rails/src/layout/component/Draw.js +79 -0
  379. data/app/assets/javascripts/extjs-rails/src/layout/component/FieldSet.js +62 -0
  380. data/app/assets/javascripts/extjs-rails/src/layout/component/ProgressBar.js +54 -0
  381. data/app/assets/javascripts/extjs-rails/src/layout/component/Tab.js +23 -0
  382. data/app/assets/javascripts/extjs-rails/src/layout/component/field/ComboBox.js +52 -0
  383. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Field.js +372 -0
  384. data/app/assets/javascripts/extjs-rails/src/layout/component/field/FieldContainer.js +48 -0
  385. data/app/assets/javascripts/extjs-rails/src/layout/component/field/HtmlEditor.js +54 -0
  386. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Slider.js +58 -0
  387. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Text.js +75 -0
  388. data/app/assets/javascripts/extjs-rails/src/layout/component/field/TextArea.js +51 -0
  389. data/app/assets/javascripts/extjs-rails/src/layout/component/field/Trigger.js +132 -0
  390. data/app/assets/javascripts/extjs-rails/src/layout/container/Absolute.js +121 -0
  391. data/app/assets/javascripts/extjs-rails/src/layout/container/Accordion.js +308 -0
  392. data/app/assets/javascripts/extjs-rails/src/layout/container/Anchor.js +403 -0
  393. data/app/assets/javascripts/extjs-rails/src/layout/container/Auto.js +70 -0
  394. data/app/assets/javascripts/extjs-rails/src/layout/container/Border-old-js +1079 -0
  395. data/app/assets/javascripts/extjs-rails/src/layout/container/Border.js +816 -0
  396. data/app/assets/javascripts/extjs-rails/src/layout/container/Box.js +929 -0
  397. data/app/assets/javascripts/extjs-rails/src/layout/container/Card.js +361 -0
  398. data/app/assets/javascripts/extjs-rails/src/layout/container/CheckboxGroup.js +376 -0
  399. data/app/assets/javascripts/extjs-rails/src/layout/container/Column.js +234 -0
  400. data/app/assets/javascripts/extjs-rails/src/layout/container/Container.js +961 -0
  401. data/app/assets/javascripts/extjs-rails/src/layout/container/Editor.js +74 -0
  402. data/app/assets/javascripts/extjs-rails/src/layout/container/Fit.js +287 -0
  403. data/app/assets/javascripts/extjs-rails/src/layout/container/Form.js +157 -0
  404. data/app/assets/javascripts/extjs-rails/src/layout/container/HBox.js +134 -0
  405. data/app/assets/javascripts/extjs-rails/src/layout/container/Table.js +412 -0
  406. data/app/assets/javascripts/extjs-rails/src/layout/container/VBox.js +139 -0
  407. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Menu.js +365 -0
  408. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/None.js +83 -0
  409. data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Scroller.js +475 -0
  410. data/app/assets/javascripts/extjs-rails/src/menu/CheckItem.js +169 -0
  411. data/app/assets/javascripts/extjs-rails/src/menu/ColorPicker.js +110 -0
  412. data/app/assets/javascripts/extjs-rails/src/menu/DatePicker.js +100 -0
  413. data/app/assets/javascripts/extjs-rails/src/menu/Item.js +553 -0
  414. data/app/assets/javascripts/extjs-rails/src/menu/KeyNav.js +134 -0
  415. data/app/assets/javascripts/extjs-rails/src/menu/Manager.js +219 -0
  416. data/app/assets/javascripts/extjs-rails/src/menu/Menu.js +579 -0
  417. data/app/assets/javascripts/extjs-rails/src/menu/Separator.js +126 -0
  418. data/app/assets/javascripts/extjs-rails/src/panel/AbstractPanel.js +323 -0
  419. data/app/assets/javascripts/extjs-rails/src/panel/DD.js +99 -0
  420. data/app/assets/javascripts/extjs-rails/src/panel/Header.js +518 -0
  421. data/app/assets/javascripts/extjs-rails/src/panel/Panel.js +2150 -0
  422. data/app/assets/javascripts/extjs-rails/src/panel/Proxy.js +131 -0
  423. data/app/assets/javascripts/extjs-rails/src/panel/Table.js +1018 -0
  424. data/app/assets/javascripts/extjs-rails/src/panel/Tool.js +304 -0
  425. data/app/assets/javascripts/extjs-rails/src/picker/Color.js +219 -0
  426. data/app/assets/javascripts/extjs-rails/src/picker/Date.js +1140 -0
  427. data/app/assets/javascripts/extjs-rails/src/picker/Month.js +490 -0
  428. data/app/assets/javascripts/extjs-rails/src/picker/Time.js +165 -0
  429. data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitter.js +22 -0
  430. data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitterTracker.js +210 -0
  431. data/app/assets/javascripts/extjs-rails/src/resizer/Handle.js +29 -0
  432. data/app/assets/javascripts/extjs-rails/src/resizer/ResizeTracker.js +346 -0
  433. data/app/assets/javascripts/extjs-rails/src/resizer/Resizer.js +477 -0
  434. data/app/assets/javascripts/extjs-rails/src/resizer/Splitter.js +242 -0
  435. data/app/assets/javascripts/extjs-rails/src/resizer/SplitterTracker.js +230 -0
  436. data/app/assets/javascripts/extjs-rails/src/selection/CellModel.js +395 -0
  437. data/app/assets/javascripts/extjs-rails/src/selection/CheckboxModel.js +234 -0
  438. data/app/assets/javascripts/extjs-rails/src/selection/DataViewModel.js +160 -0
  439. data/app/assets/javascripts/extjs-rails/src/selection/Model.js +646 -0
  440. data/app/assets/javascripts/extjs-rails/src/selection/RowModel.js +499 -0
  441. data/app/assets/javascripts/extjs-rails/src/selection/TreeModel.js +78 -0
  442. data/app/assets/javascripts/extjs-rails/src/slider/Multi.js +835 -0
  443. data/app/assets/javascripts/extjs-rails/src/slider/Single.js +56 -0
  444. data/app/assets/javascripts/extjs-rails/src/slider/Thumb.js +259 -0
  445. data/app/assets/javascripts/extjs-rails/src/slider/Tip.js +130 -0
  446. data/app/assets/javascripts/extjs-rails/src/state/CookieProvider.js +120 -0
  447. data/app/assets/javascripts/extjs-rails/src/state/LocalStorageProvider.js +72 -0
  448. data/app/assets/javascripts/extjs-rails/src/state/Manager.js +70 -0
  449. data/app/assets/javascripts/extjs-rails/src/state/Provider.js +182 -0
  450. data/app/assets/javascripts/extjs-rails/src/state/Stateful.js +364 -0
  451. data/app/assets/javascripts/extjs-rails/src/tab/Bar.js +258 -0
  452. data/app/assets/javascripts/extjs-rails/src/tab/Panel.js +654 -0
  453. data/app/assets/javascripts/extjs-rails/src/tab/Tab.js +358 -0
  454. data/app/assets/javascripts/extjs-rails/src/tail.js +10 -0
  455. data/app/assets/javascripts/extjs-rails/src/tip/QuickTip.js +335 -0
  456. data/app/assets/javascripts/extjs-rails/src/tip/QuickTipManager.js +239 -0
  457. data/app/assets/javascripts/extjs-rails/src/tip/Tip.js +160 -0
  458. data/app/assets/javascripts/extjs-rails/src/tip/ToolTip.js +691 -0
  459. data/app/assets/javascripts/extjs-rails/src/toolbar/Fill.js +28 -0
  460. data/app/assets/javascripts/extjs-rails/src/toolbar/Item.js +16 -0
  461. data/app/assets/javascripts/extjs-rails/src/toolbar/Paging.js +600 -0
  462. data/app/assets/javascripts/extjs-rails/src/toolbar/Separator.js +23 -0
  463. data/app/assets/javascripts/extjs-rails/src/toolbar/Spacer.js +33 -0
  464. data/app/assets/javascripts/extjs-rails/src/toolbar/TextItem.js +57 -0
  465. data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar-legacy.js +123 -0
  466. data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar.js +447 -0
  467. data/app/assets/javascripts/extjs-rails/src/tree/Column.js +90 -0
  468. data/app/assets/javascripts/extjs-rails/src/tree/Panel.js +505 -0
  469. data/app/assets/javascripts/extjs-rails/src/tree/View.js +658 -0
  470. data/app/assets/javascripts/extjs-rails/src/tree/ViewDragZone.js +49 -0
  471. data/app/assets/javascripts/extjs-rails/src/tree/ViewDropZone.js +287 -0
  472. data/app/assets/javascripts/extjs-rails/src/tree/plugin/TreeViewDragDrop.js +244 -0
  473. data/app/assets/javascripts/extjs-rails/src/util/AbstractMixedCollection.js +772 -0
  474. data/app/assets/javascripts/extjs-rails/src/util/Animate.js +426 -0
  475. data/app/assets/javascripts/extjs-rails/src/util/Bindable.js +102 -0
  476. data/app/assets/javascripts/extjs-rails/src/util/CSS.js +185 -0
  477. data/app/assets/javascripts/extjs-rails/src/util/ClickRepeater.js +238 -0
  478. data/app/assets/javascripts/extjs-rails/src/util/ComponentDragger.js +126 -0
  479. data/app/assets/javascripts/extjs-rails/src/util/Cookies.js +91 -0
  480. data/app/assets/javascripts/extjs-rails/src/util/ElementContainer.js +293 -0
  481. data/app/assets/javascripts/extjs-rails/src/util/Filter.js +159 -0
  482. data/app/assets/javascripts/extjs-rails/src/util/Floating.js +321 -0
  483. data/app/assets/javascripts/extjs-rails/src/util/Grouper.js +26 -0
  484. data/app/assets/javascripts/extjs-rails/src/util/HashMap.js +356 -0
  485. data/app/assets/javascripts/extjs-rails/src/util/History.js +285 -0
  486. data/app/assets/javascripts/extjs-rails/src/util/Inflector.js +297 -0
  487. data/app/assets/javascripts/extjs-rails/src/util/KeyMap.js +427 -0
  488. data/app/assets/javascripts/extjs-rails/src/util/KeyNav.js +239 -0
  489. data/app/assets/javascripts/extjs-rails/src/util/LruCache.js +257 -0
  490. data/app/assets/javascripts/extjs-rails/src/util/Memento.js +131 -0
  491. data/app/assets/javascripts/extjs-rails/src/util/MixedCollection.js +239 -0
  492. data/app/assets/javascripts/extjs-rails/src/util/Observable.js +1003 -0
  493. data/app/assets/javascripts/extjs-rails/src/util/Offset.js +60 -0
  494. data/app/assets/javascripts/extjs-rails/src/util/Point.js +93 -0
  495. data/app/assets/javascripts/extjs-rails/src/util/ProtoElement.js +205 -0
  496. data/app/assets/javascripts/extjs-rails/src/util/Queue.js +76 -0
  497. data/app/assets/javascripts/extjs-rails/src/util/Region.js +388 -0
  498. data/app/assets/javascripts/extjs-rails/src/util/Renderable.js +1079 -0
  499. data/app/assets/javascripts/extjs-rails/src/util/Sortable.js +248 -0
  500. data/app/assets/javascripts/extjs-rails/src/util/Sorter.js +179 -0
  501. data/app/assets/javascripts/extjs-rails/src/util/TextMetrics.js +148 -0
  502. data/app/assets/javascripts/extjs-rails/src/view/AbstractView.js +1103 -0
  503. data/app/assets/javascripts/extjs-rails/src/view/BoundList.js +207 -0
  504. data/app/assets/javascripts/extjs-rails/src/view/BoundListKeyNav.js +92 -0
  505. data/app/assets/javascripts/extjs-rails/src/view/DragZone.js +106 -0
  506. data/app/assets/javascripts/extjs-rails/src/view/DropZone.js +240 -0
  507. data/app/assets/javascripts/extjs-rails/src/view/Table.js +1229 -0
  508. data/app/assets/javascripts/extjs-rails/src/view/TableChunker.js +139 -0
  509. data/app/assets/javascripts/extjs-rails/src/view/View.js +636 -0
  510. data/app/assets/javascripts/extjs-rails/src/window/MessageBox.js +880 -0
  511. data/app/assets/javascripts/extjs-rails/src/window/Window-legacy.js +56 -0
  512. data/app/assets/javascripts/extjs-rails/src/window/Window.js +793 -0
  513. data/extjs-rails.gemspec +24 -0
  514. data/lib/extjs-rails.rb +7 -0
  515. data/lib/extjs-rails/engine.rb +7 -0
  516. data/lib/extjs-rails/version.rb +5 -0
  517. metadata +660 -0
@@ -0,0 +1,1229 @@
1
+ /**
2
+ * This class encapsulates the user interface for a tabular data set.
3
+ * It acts as a centralized manager for controlling the various interface
4
+ * elements of the view. This includes handling events, such as row and cell
5
+ * level based DOM events. It also reacts to events from the underlying {@link Ext.selection.Model}
6
+ * to provide visual feedback to the user.
7
+ *
8
+ * This class does not provide ways to manipulate the underlying data of the configured
9
+ * {@link Ext.data.Store}.
10
+ *
11
+ * This is the base class for both {@link Ext.grid.View} and {@link Ext.tree.View} and is not
12
+ * to be used directly.
13
+ */
14
+ Ext.define('Ext.view.Table', {
15
+ extend: 'Ext.view.View',
16
+ alias: 'widget.tableview',
17
+ uses: [
18
+ 'Ext.view.TableChunker',
19
+ 'Ext.util.DelayedTask',
20
+ 'Ext.util.MixedCollection'
21
+ ],
22
+
23
+ baseCls: Ext.baseCSSPrefix + 'grid-view',
24
+
25
+ // row
26
+ itemSelector: 'tr.' + Ext.baseCSSPrefix + 'grid-row',
27
+ // cell
28
+ cellSelector: 'td.' + Ext.baseCSSPrefix + 'grid-cell',
29
+
30
+ // keep a separate rowSelector, since we may need to select the actual row elements
31
+ rowSelector: 'tr.' + Ext.baseCSSPrefix + 'grid-row',
32
+
33
+ /**
34
+ * @cfg {String} [firstCls='x-grid-cell-first']
35
+ * A CSS class to add to the *first* cell in every row to enable special styling for the first column.
36
+ * If no styling is needed on the first column, this may be configured as `null`.
37
+ */
38
+ firstCls: Ext.baseCSSPrefix + 'grid-cell-first',
39
+
40
+ /**
41
+ * @cfg {String} [lastCls='x-grid-cell-last']
42
+ * A CSS class to add to the *last* cell in every row to enable special styling for the last column.
43
+ * If no styling is needed on the last column, this may be configured as `null`.
44
+ */
45
+ lastCls: Ext.baseCSSPrefix + 'grid-cell-last',
46
+
47
+ headerRowSelector: 'tr.' + Ext.baseCSSPrefix + 'grid-header-row',
48
+
49
+ selectedItemCls: Ext.baseCSSPrefix + 'grid-row-selected',
50
+ selectedCellCls: Ext.baseCSSPrefix + 'grid-cell-selected',
51
+ focusedItemCls: Ext.baseCSSPrefix + 'grid-row-focused',
52
+ overItemCls: Ext.baseCSSPrefix + 'grid-row-over',
53
+ altRowCls: Ext.baseCSSPrefix + 'grid-row-alt',
54
+ rowClsRe: new RegExp('(?:^|\\s*)' + Ext.baseCSSPrefix + 'grid-row-(first|last|alt)(?:\\s+|$)', 'g'),
55
+ cellRe: new RegExp(Ext.baseCSSPrefix + 'grid-cell-([^\\s]+) ', ''),
56
+
57
+ // cfg docs inherited
58
+ trackOver: true,
59
+
60
+ /**
61
+ * Override this function to apply custom CSS classes to rows during rendering. This function should return the
62
+ * CSS class name (or empty string '' for none) that will be added to the row's wrapping div. To apply multiple
63
+ * class names, simply return them space-delimited within the string (e.g. 'my-class another-class').
64
+ * Example usage:
65
+ *
66
+ * viewConfig: {
67
+ * getRowClass: function(record, rowIndex, rowParams, store){
68
+ * return record.get("valid") ? "row-valid" : "row-error";
69
+ * }
70
+ * }
71
+ *
72
+ * @param {Ext.data.Model} record The record corresponding to the current row.
73
+ * @param {Number} index The row index.
74
+ * @param {Object} rowParams **DEPRECATED.** For row body use the
75
+ * {@link Ext.grid.feature.RowBody#getAdditionalData getAdditionalData} method of the rowbody feature.
76
+ * @param {Ext.data.Store} store The store this grid is bound to
77
+ * @return {String} a CSS class name to add to the row.
78
+ * @method
79
+ */
80
+ getRowClass: null,
81
+
82
+ /**
83
+ * @cfg {Boolean} stripeRows
84
+ * True to stripe the rows.
85
+ *
86
+ * This causes the CSS class **`x-grid-row-alt`** to be added to alternate rows of
87
+ * the grid. A default CSS rule is provided which sets a background color, but you can override this
88
+ * with a rule which either overrides the **background-color** style using the `!important`
89
+ * modifier, or which uses a CSS selector of higher specificity.
90
+ */
91
+ stripeRows: true,
92
+
93
+ /**
94
+ * @cfg {Boolean} markDirty
95
+ * True to show the dirty cell indicator when a cell has been modified.
96
+ */
97
+ markDirty : true,
98
+
99
+ /**
100
+ * @cfg {Boolean} enableTextSelection
101
+ * True to enable text selections.
102
+ */
103
+
104
+ initComponent: function() {
105
+ var me = this,
106
+ scroll = me.scroll;
107
+
108
+ // Scrolling within a TableView is controlled by the scroll config of its owning GridPanel
109
+ // It must see undefined in this property in order to leave the scroll styles alone at afterRender time
110
+ me.autoScroll = undefined;
111
+
112
+ //Scrolling is handled at the View's element level
113
+ if (scroll === true || scroll === 'both') {
114
+ me.style = Ext.apply(me.style||{}, {
115
+ overflow: 'auto'
116
+ });
117
+ } else if (scroll === 'horizontal') {
118
+ me.style = Ext.apply(me.style||{}, {
119
+ "overflow-x": 'auto',
120
+ "overflow-y": 'hidden'
121
+ });
122
+ } else if (scroll === 'vertical') {
123
+ me.style = Ext.apply(me.style||{}, {
124
+ "overflow-x": 'hidden',
125
+ "overflow-y": 'auto'
126
+ });
127
+ } else {
128
+ me.style = Ext.apply(me.style||{}, {
129
+ overflow: 'hidden'
130
+ });
131
+ }
132
+ me.selModel.view = me;
133
+ me.headerCt.view = me;
134
+ me.headerCt.markDirty = me.markDirty;
135
+
136
+ // Features need a reference to the grid.
137
+ me.initFeatures(me.grid);
138
+ delete me.grid;
139
+
140
+ me.tpl = '<div></div>';
141
+ me.callParent();
142
+ },
143
+
144
+ /**
145
+ * @private
146
+ * Move a grid column from one position to another
147
+ * @param {Number} fromIdx The index from which to move columns
148
+ * @param {Number} toIdx The index at which to insert columns.
149
+ * @param {Number} [colsToMove=1] The number of columns to move beginning at the `fromIdx`
150
+ */
151
+ moveColumn: function(fromIdx, toIdx, colsToMove) {
152
+ var me = this,
153
+ fragment = (colsToMove > 1) ? document.createDocumentFragment() : undefined,
154
+ destinationCellIdx = toIdx,
155
+ colCount = me.getGridColumns().length,
156
+ lastIdx = colCount - 1,
157
+ doFirstLastClasses = (me.firstCls || me.lastCls) && (toIdx == 0 || toIdx == colCount || fromIdx == 0 || fromIdx == lastIdx),
158
+ i,
159
+ j,
160
+ rows, len, tr, headerRows;
161
+
162
+ if (me.rendered) {
163
+ // Use select here. In most cases there will only be one row. In
164
+ // the case of a grouping grid, each group also has a header.
165
+ headerRows = me.el.query(me.headerRowSelector);
166
+ rows = me.el.query(me.rowSelector);
167
+
168
+ if (toIdx > fromIdx && fragment) {
169
+ destinationCellIdx -= colsToMove;
170
+ }
171
+
172
+ // Move the column sizing header to match
173
+ for (i = 0, len = headerRows.length; i < len; ++i) {
174
+ tr = headerRows[i];
175
+ if (fragment) {
176
+ for (j = 0; j < colsToMove; j++) {
177
+ fragment.appendChild(tr.cells[fromIdx]);
178
+ }
179
+ tr.insertBefore(fragment, tr.cells[destinationCellIdx] || null);
180
+ } else {
181
+ tr.insertBefore(tr.cells[fromIdx], tr.cells[destinationCellIdx] || null);
182
+ }
183
+ }
184
+
185
+ for (i = 0, len = rows.length; i < len; i++) {
186
+ tr = rows[i];
187
+
188
+ // Keep first cell class and last cell class correct *only if needed*
189
+ if (doFirstLastClasses) {
190
+
191
+ if (fromIdx === 0) {
192
+ Ext.fly(tr.cells[0]).removeCls(me.firstCls);
193
+ Ext.fly(tr.cells[1]).addCls(me.firstCls);
194
+ } else if (fromIdx === lastIdx) {
195
+ Ext.fly(tr.cells[lastIdx]).removeCls(me.lastCls);
196
+ Ext.fly(tr.cells[lastIdx - 1]).addCls(me.lastCls);
197
+ }
198
+ if (toIdx === 0) {
199
+ Ext.fly(tr.cells[0]).removeCls(me.firstCls);
200
+ Ext.fly(tr.cells[fromIdx]).addCls(me.firstCls);
201
+ } else if (toIdx === colCount) {
202
+ Ext.fly(tr.cells[lastIdx]).removeCls(me.lastCls);
203
+ Ext.fly(tr.cells[fromIdx]).addCls(me.lastCls);
204
+ }
205
+ }
206
+
207
+ if (fragment) {
208
+ for (j = 0; j < colsToMove; j++) {
209
+ fragment.appendChild(tr.cells[fromIdx]);
210
+ }
211
+ tr.insertBefore(fragment, tr.cells[destinationCellIdx] || null);
212
+ } else {
213
+ tr.insertBefore(tr.cells[fromIdx], tr.cells[destinationCellIdx] || null);
214
+ }
215
+ }
216
+ me.setNewTemplate();
217
+ }
218
+ },
219
+
220
+ // scroll the view to the top
221
+ scrollToTop: Ext.emptyFn,
222
+
223
+ /**
224
+ * Add a listener to the main view element. It will be destroyed with the view.
225
+ * @private
226
+ */
227
+ addElListener: function(eventName, fn, scope){
228
+ this.mon(this, eventName, fn, scope, {
229
+ element: 'el'
230
+ });
231
+ },
232
+
233
+ /**
234
+ * Get the columns used for generating a template via TableChunker.
235
+ * See {@link Ext.grid.header.Container#getGridColumns}.
236
+ * @private
237
+ */
238
+ getGridColumns: function() {
239
+ return this.headerCt.getGridColumns();
240
+ },
241
+
242
+ /**
243
+ * Get a leaf level header by index regardless of what the nesting
244
+ * structure is.
245
+ * @private
246
+ * @param {Number} index The index
247
+ */
248
+ getHeaderAtIndex: function(index) {
249
+ return this.headerCt.getHeaderAtIndex(index);
250
+ },
251
+
252
+ /**
253
+ * Get the cell (td) for a particular record and column.
254
+ * @param {Ext.data.Model} record
255
+ * @param {Ext.grid.column.Column} column
256
+ * @private
257
+ */
258
+ getCell: function(record, column) {
259
+ var row = this.getNode(record);
260
+ return Ext.fly(row).down(column.getCellSelector());
261
+ },
262
+
263
+ /**
264
+ * Get a reference to a feature
265
+ * @param {String} id The id of the feature
266
+ * @return {Ext.grid.feature.Feature} The feature. Undefined if not found
267
+ */
268
+ getFeature: function(id) {
269
+ var features = this.featuresMC;
270
+ if (features) {
271
+ return features.get(id);
272
+ }
273
+ },
274
+
275
+ /**
276
+ * Initializes each feature and bind it to this view.
277
+ * @private
278
+ */
279
+ initFeatures: function(grid) {
280
+ var me = this,
281
+ i,
282
+ features,
283
+ feature,
284
+ len;
285
+
286
+ me.featuresMC = new Ext.util.MixedCollection();
287
+ features = me.features = me.prepareFeatures();
288
+ len = features ? features.length : 0;
289
+ for (i = 0; i < len; i++) {
290
+ feature = features[i];
291
+
292
+ // inject a reference to view and grid - Features need both
293
+ feature.view = me;
294
+ feature.grid = grid;
295
+ me.featuresMC.add(feature);
296
+ feature.init();
297
+ }
298
+ },
299
+
300
+ /**
301
+ * @private
302
+ * Converts the features array as configured, into an array of instantiated Feature objects.
303
+ *
304
+ * This is borrowed by Lockable which clones and distributes Features to both child grids of a locking grid.
305
+ *
306
+ * Must have no side effects other than Feature instantiation.
307
+ *
308
+ * MUST NOT update the this.features property, and MUST NOT update the instantiated Features.
309
+ */
310
+ prepareFeatures: function() {
311
+ var me = this,
312
+ features = me.features,
313
+ feature,
314
+ result,
315
+ i = 0, len;
316
+
317
+ if (features) {
318
+ result = [];
319
+ len = features.length;
320
+ for (; i < len; i++) {
321
+ feature = features[i];
322
+ if (!feature.isFeature) {
323
+ feature = Ext.create('feature.' + feature.ftype, feature);
324
+ }
325
+ result[i] = feature;
326
+ }
327
+ }
328
+ return result;
329
+ },
330
+
331
+ /**
332
+ * Gives features an injection point to attach events to the markup that
333
+ * has been created for this view.
334
+ * @private
335
+ */
336
+ attachEventsForFeatures: function() {
337
+ var features = this.features,
338
+ ln = features.length,
339
+ i = 0;
340
+
341
+ for (; i < ln; i++) {
342
+ if (features[i].isFeature) {
343
+ features[i].attachEvents();
344
+ }
345
+ }
346
+ },
347
+
348
+ afterRender: function() {
349
+ var me = this;
350
+ me.callParent();
351
+
352
+ if (!me.enableTextSelection) {
353
+ me.el.unselectable();
354
+ }
355
+ me.attachEventsForFeatures();
356
+ },
357
+
358
+ // Private template method implemented starting at the AbstractView class.
359
+ onViewScroll: function(e, t) {
360
+ this.callParent(arguments);
361
+ this.fireEvent('bodyscroll', e, t);
362
+ },
363
+
364
+ /**
365
+ * Uses the headerCt (Which is the repository of all information relating to Column definitions)
366
+ * to transform data from dataIndex keys in a record to headerId keys in each header and then run
367
+ * them through each feature to get additional data for variables they have injected into the view template.
368
+ * @private
369
+ */
370
+ prepareData: function(data, idx, record) {
371
+ var me = this,
372
+ result = me.headerCt.prepareData(data, idx, record, me, me.ownerCt),
373
+ features = me.features,
374
+ ln = features.length,
375
+ i = 0,
376
+ feature;
377
+
378
+ for (; i < ln; i++) {
379
+ feature = features[i];
380
+ if (feature.isFeature) {
381
+ Ext.apply(result, feature.getAdditionalData(data, idx, record, result, me));
382
+ }
383
+ }
384
+
385
+ return result;
386
+ },
387
+
388
+ // TODO: Refactor headerCt dependency here to colModel
389
+ collectData: function(records, startIndex) {
390
+ var preppedRecords = this.callParent(arguments),
391
+ headerCt = this.headerCt,
392
+ fullWidth = headerCt.getFullWidth(),
393
+ features = this.features,
394
+ ln = features.length,
395
+ o = {
396
+ rows: preppedRecords,
397
+ fullWidth: fullWidth
398
+ },
399
+ i = 0,
400
+ feature,
401
+ j = 0,
402
+ jln,
403
+ rowParams,
404
+ rec,
405
+ cls;
406
+
407
+ jln = preppedRecords.length;
408
+ // process row classes, rowParams has been deprecated and has been moved
409
+ // to the individual features that implement the behavior.
410
+ if (this.getRowClass) {
411
+ for (; j < jln; j++) {
412
+ rowParams = {};
413
+ rec = preppedRecords[j];
414
+ cls = rec.rowCls || '';
415
+ rec.rowCls = this.getRowClass(records[j], j, rowParams, this.store) + ' ' + cls;
416
+ //<debug>
417
+ if (rowParams.alt) {
418
+ Ext.Error.raise("The getRowClass alt property is no longer supported.");
419
+ }
420
+ if (rowParams.tstyle) {
421
+ Ext.Error.raise("The getRowClass tstyle property is no longer supported.");
422
+ }
423
+ if (rowParams.cells) {
424
+ Ext.Error.raise("The getRowClass cells property is no longer supported.");
425
+ }
426
+ if (rowParams.body) {
427
+ Ext.Error.raise("The getRowClass body property is no longer supported. Use the getAdditionalData method of the rowbody feature.");
428
+ }
429
+ if (rowParams.bodyStyle) {
430
+ Ext.Error.raise("The getRowClass bodyStyle property is no longer supported.");
431
+ }
432
+ if (rowParams.cols) {
433
+ Ext.Error.raise("The getRowClass cols property is no longer supported.");
434
+ }
435
+ //</debug>
436
+ }
437
+ }
438
+ // currently only one feature may implement collectData. This is to modify
439
+ // what's returned to the view before its rendered
440
+ for (; i < ln; i++) {
441
+ feature = features[i];
442
+ if (feature.isFeature && feature.collectData && !feature.disabled) {
443
+ o = feature.collectData(records, preppedRecords, startIndex, fullWidth, o);
444
+ break;
445
+ }
446
+ }
447
+ return o;
448
+ },
449
+
450
+ /**
451
+ * In FF10, flex columns transitioning from hidden to visible may not always be
452
+ * displayed properly initially. Simply re-measuring the width after the styling
453
+ * changes take place seems to be enough to poke the browser into doing it's thing
454
+ * @private
455
+ */
456
+ forceReflow: Ext.isGecko10
457
+ ? function() {
458
+ var el = this.el.down('table'),
459
+ width;
460
+ if (el) {
461
+ width = el.getWidth();
462
+ }
463
+ }
464
+ : Ext.emptyFn,
465
+
466
+ /**
467
+ * When a header is resized, setWidth on the individual columns resizer class,
468
+ * the top level table, save/restore scroll state, generate a new template and
469
+ * restore focus to the grid view's element so that keyboard navigation
470
+ * continues to work.
471
+ * @private
472
+ */
473
+ onHeaderResize: function(header, w, suppressFocus) {
474
+ var me = this,
475
+ el = me.el;
476
+
477
+ if (el) {
478
+ // Grab the col and set the width, css
479
+ // class is generated in TableChunker.
480
+ // Select composites because there may be several chunks.
481
+ el.select('th.' + Ext.baseCSSPrefix + 'grid-col-resizer-'+header.id).setWidth(w);
482
+ el.select('table.' + Ext.baseCSSPrefix + 'grid-table-resizer').setWidth(me.headerCt.getFullWidth());
483
+ if (!me.ignoreTemplate) {
484
+ me.setNewTemplate();
485
+ }
486
+ if (!suppressFocus) {
487
+ me.el.focus();
488
+ }
489
+ me.forceReflow();
490
+ }
491
+ },
492
+
493
+ /**
494
+ * When a header is shown restore its oldWidth if it was previously hidden.
495
+ * @private
496
+ */
497
+ onHeaderShow: function(headerCt, header, suppressFocus) {
498
+ var me = this;
499
+ me.ignoreTemplate = true;
500
+ // restore headers that were dynamically hidden
501
+ if (header.oldWidth) {
502
+ me.onHeaderResize(header, header.oldWidth, suppressFocus);
503
+ delete header.oldWidth;
504
+ // flexed headers will have a calculated size set
505
+ // this additional check has to do with the fact that
506
+ // defaults: {width: 100} will fight with a flex value
507
+ } else if (header.width && !header.flex) {
508
+ me.onHeaderResize(header, header.width, suppressFocus);
509
+ } else if (header.el) {
510
+ me.onHeaderResize(header, header.el.getWidth(), suppressFocus);
511
+ }
512
+ delete me.ignoreTemplate;
513
+ me.setNewTemplate();
514
+ },
515
+
516
+ /**
517
+ * When the header hides treat it as a resize to 0.
518
+ * @private
519
+ */
520
+ onHeaderHide: function(headerCt, header, suppressFocus) {
521
+ this.onHeaderResize(header, 0, suppressFocus);
522
+ },
523
+
524
+ // Private. Called when the table changes height.
525
+ // For example, see examples/grid/group-summary-grid.html
526
+ // If we have flexed column headers, we need to update the header layout
527
+ // because it may have to accommodate (or cease to accommodate) a vertical scrollbar.
528
+ // Only do this on platforms with have a space-consuming scrollbar
529
+ refreshSize: function() {
530
+ var me = this,
531
+ cmp;
532
+
533
+ if (!me.hasLoadingHeight) {
534
+ cmp = me.up('tablepanel');
535
+
536
+ // Suspend layouts in case the superclass requests a layout. We might too, so they
537
+ // must be coalescsed.
538
+ Ext.suspendLayouts();
539
+
540
+ me.callParent();
541
+
542
+ if (cmp && Ext.getScrollbarSize().width) {
543
+ cmp.updateLayout();
544
+ }
545
+
546
+ Ext.resumeLayouts(true);
547
+ }
548
+ },
549
+
550
+ /**
551
+ * Set a new template based on the current columns displayed in the grid.
552
+ * @private
553
+ */
554
+ setNewTemplate: function() {
555
+ var me = this,
556
+ columns = me.headerCt.getColumnsForTpl(true);
557
+
558
+ // Template generation requires the rowCount as well as the column definitions and features.
559
+ me.tpl = me.getTableChunker().getTableTpl({
560
+ rowCount: me.store.getCount(),
561
+ columns: columns,
562
+ features: me.features,
563
+ enableTextSelection: me.enableTextSelection
564
+ });
565
+ },
566
+
567
+ /**
568
+ * Returns the configured chunker or default of Ext.view.TableChunker
569
+ */
570
+ getTableChunker: function() {
571
+ return this.chunker || Ext.view.TableChunker;
572
+ },
573
+
574
+ /**
575
+ * Adds a CSS Class to a specific row.
576
+ * @param {HTMLElement/String/Number/Ext.data.Model} rowInfo An HTMLElement, index or instance of a model
577
+ * representing this row
578
+ * @param {String} cls
579
+ */
580
+ addRowCls: function(rowInfo, cls) {
581
+ var row = this.getNode(rowInfo);
582
+ if (row) {
583
+ Ext.fly(row).addCls(cls);
584
+ }
585
+ },
586
+
587
+ /**
588
+ * Removes a CSS Class from a specific row.
589
+ * @param {HTMLElement/String/Number/Ext.data.Model} rowInfo An HTMLElement, index or instance of a model
590
+ * representing this row
591
+ * @param {String} cls
592
+ */
593
+ removeRowCls: function(rowInfo, cls) {
594
+ var row = this.getNode(rowInfo);
595
+ if (row) {
596
+ Ext.fly(row).removeCls(cls);
597
+ }
598
+ },
599
+
600
+ // GridSelectionModel invokes onRowSelect as selection changes
601
+ onRowSelect : function(rowIdx) {
602
+ this.addRowCls(rowIdx, this.selectedItemCls);
603
+ },
604
+
605
+ // GridSelectionModel invokes onRowDeselect as selection changes
606
+ onRowDeselect : function(rowIdx) {
607
+ var me = this;
608
+
609
+ me.removeRowCls(rowIdx, me.selectedItemCls);
610
+ me.removeRowCls(rowIdx, me.focusedItemCls);
611
+ },
612
+
613
+ onCellSelect: function(position) {
614
+ var cell = this.getCellByPosition(position);
615
+ if (cell) {
616
+ cell.addCls(this.selectedCellCls);
617
+ }
618
+ },
619
+
620
+ onCellDeselect: function(position) {
621
+ var cell = this.getCellByPosition(position);
622
+ if (cell) {
623
+ cell.removeCls(this.selectedCellCls);
624
+ }
625
+
626
+ },
627
+
628
+ onCellFocus: function(position) {
629
+ this.focusCell(position);
630
+ },
631
+
632
+ getCellByPosition: function(position) {
633
+ if (position) {
634
+ var node = this.getNode(position.row),
635
+ header = this.headerCt.getHeaderAtIndex(position.column);
636
+
637
+ if (header && node) {
638
+ return Ext.fly(node).down(header.getCellSelector());
639
+ }
640
+ }
641
+ return false;
642
+ },
643
+
644
+ // GridSelectionModel invokes onRowFocus to 'highlight'
645
+ // the last row focused
646
+ onRowFocus: function(rowIdx, highlight, supressFocus) {
647
+ var me = this;
648
+
649
+ if (highlight) {
650
+ me.addRowCls(rowIdx, me.focusedItemCls);
651
+ if (!supressFocus) {
652
+ me.focusRow(rowIdx);
653
+ }
654
+ //this.el.dom.setAttribute('aria-activedescendant', row.id);
655
+ } else {
656
+ me.removeRowCls(rowIdx, me.focusedItemCls);
657
+ }
658
+ },
659
+
660
+ /**
661
+ * Focuses a particular row and brings it into view. Will fire the rowfocus event.
662
+ * @param {HTMLElement/String/Number/Ext.data.Model} rowIdx
663
+ * An HTMLElement template node, index of a template node, the id of a template node or the
664
+ * record associated with the node.
665
+ */
666
+ focusRow: function(rowIdx) {
667
+ var me = this,
668
+ row = me.getNode(rowIdx),
669
+ el = me.el,
670
+ adjustment = 0,
671
+ panel = me.ownerCt,
672
+ rowRegion,
673
+ elTop,
674
+ elBottom,
675
+ record;
676
+
677
+ if (row && el) {
678
+ // Viewable region must not include scrollbars, so use
679
+ // DOM clientHeight to determine height
680
+ elTop = el.getY();
681
+ elBottom = elTop + el.dom.clientHeight;
682
+ rowRegion = Ext.fly(row).getRegion();
683
+ // row is above
684
+ if (rowRegion.top < elTop) {
685
+ adjustment = rowRegion.top - elTop;
686
+ // row is below
687
+ } else if (rowRegion.bottom > elBottom) {
688
+ adjustment = rowRegion.bottom - elBottom;
689
+ }
690
+ record = me.getRecord(row);
691
+ rowIdx = me.store.indexOf(record);
692
+
693
+ if (adjustment) {
694
+ panel.scrollByDeltaY(adjustment);
695
+ }
696
+ me.fireEvent('rowfocus', record, row, rowIdx);
697
+ }
698
+ },
699
+
700
+ focusCell: function(position) {
701
+ var me = this,
702
+ cell = me.getCellByPosition(position),
703
+ el = me.el,
704
+ adjustmentY = 0,
705
+ adjustmentX = 0,
706
+ elRegion = el.getRegion(),
707
+ panel = me.ownerCt,
708
+ cellRegion,
709
+ record;
710
+
711
+ // Viewable region must not include scrollbars, so use
712
+ // DOM client dimensions
713
+ elRegion.bottom = elRegion.top + el.dom.clientHeight;
714
+ elRegion.right = elRegion.left + el.dom.clientWidth;
715
+ if (cell) {
716
+ cellRegion = cell.getRegion();
717
+ // cell is above
718
+ if (cellRegion.top < elRegion.top) {
719
+ adjustmentY = cellRegion.top - elRegion.top;
720
+ // cell is below
721
+ } else if (cellRegion.bottom > elRegion.bottom) {
722
+ adjustmentY = cellRegion.bottom - elRegion.bottom;
723
+ }
724
+
725
+ // cell is left
726
+ if (cellRegion.left < elRegion.left) {
727
+ adjustmentX = cellRegion.left - elRegion.left;
728
+ // cell is right
729
+ } else if (cellRegion.right > elRegion.right) {
730
+ adjustmentX = cellRegion.right - elRegion.right;
731
+ }
732
+
733
+ if (adjustmentY) {
734
+ panel.scrollByDeltaY(adjustmentY);
735
+ }
736
+ if (adjustmentX) {
737
+ panel.scrollByDeltaX(adjustmentX);
738
+ }
739
+ el.focus();
740
+ me.fireEvent('cellfocus', record, cell, position);
741
+ }
742
+ },
743
+
744
+ /**
745
+ * Scrolls by delta. This affects this individual view ONLY and does not
746
+ * synchronize across views or scrollers.
747
+ * @param {Number} delta
748
+ * @param {String} [dir] Valid values are scrollTop and scrollLeft. Defaults to scrollTop.
749
+ * @private
750
+ */
751
+ scrollByDelta: function(delta, dir) {
752
+ dir = dir || 'scrollTop';
753
+ var elDom = this.el.dom;
754
+ elDom[dir] = (elDom[dir] += delta);
755
+ },
756
+
757
+ // private
758
+ onUpdate : function(store, record, operation, changedFieldNames) {
759
+ var me = this,
760
+ index,
761
+ newRow, oldRow,
762
+ oldCells, newCells, len, i,
763
+ columns, overItemCls,
764
+ isHovered, row;
765
+
766
+ if (me.rendered) {
767
+
768
+ index = me.store.indexOf(record);
769
+ columns = me.headerCt.getGridColumns();
770
+ overItemCls = me.overItemCls;
771
+
772
+ // If we have columns which may *need* updating (think lockable grid child with all columns either locked or unlocked)
773
+ // and the changed record is within our view, then update the view
774
+ if (columns.length && index > -1) {
775
+ newRow = me.bufferRender([record], index)[0];
776
+ oldRow = me.all.item(index);
777
+ isHovered = oldRow.hasCls(overItemCls);
778
+ oldRow.dom.className = newRow.className;
779
+ if(isHovered) {
780
+ oldRow.addCls(overItemCls);
781
+ }
782
+
783
+ // Replace changed cells in the existing row structure with the new version from the rendered row.
784
+ oldCells = oldRow.query(this.cellSelector);
785
+ newCells = Ext.fly(newRow).query(this.cellSelector);
786
+ len = newCells.length;
787
+ // row is the element that contains the cells. This will be a different element from oldRow when using a rowwrap feature
788
+ row = oldCells[0].parentNode;
789
+ for (i = 0; i < len; i++) {
790
+ // If the field at this column index was changed, replace the cell.
791
+ if (me.shouldUpdateCell(columns[i], changedFieldNames)) {
792
+ row.insertBefore(newCells[i], oldCells[i]);
793
+ row.removeChild(oldCells[i]);
794
+ }
795
+ }
796
+
797
+ // Maintain selection after update
798
+ // TODO: Move to approriate event handler.
799
+ me.selModel.refresh();
800
+ me.doStripeRows(index, index);
801
+ me.fireEvent('itemupdate', record, index, newRow);
802
+ }
803
+ }
804
+
805
+ },
806
+
807
+ shouldUpdateCell: function(column, changedFieldNames){
808
+ // Though this may not be the most efficient, a renderer could be dependent on any field in the
809
+ // store, so we must always update the cell
810
+ if (column.hasCustomRenderer) {
811
+ return true;
812
+ }
813
+ return !changedFieldNames || Ext.Array.contains(changedFieldNames, column.dataIndex);
814
+ },
815
+
816
+ /**
817
+ * Refreshes the grid view. Saves and restores the scroll state, generates a new template, stripes rows and
818
+ * invalidates the scrollers.
819
+ */
820
+ refresh: function() {
821
+ this.setNewTemplate();
822
+ this.callParent(arguments);
823
+ this.doStripeRows(0);
824
+ },
825
+
826
+ processItemEvent: function(record, row, rowIndex, e) {
827
+ var me = this,
828
+ cell = e.getTarget(me.cellSelector, row),
829
+ cellIndex = cell ? cell.cellIndex : -1,
830
+ map = me.statics().EventMap,
831
+ selModel = me.getSelectionModel(),
832
+ type = e.type,
833
+ result;
834
+
835
+ if (type == 'keydown' && !cell && selModel.getCurrentPosition) {
836
+ // CellModel, otherwise we can't tell which cell to invoke
837
+ cell = me.getCellByPosition(selModel.getCurrentPosition());
838
+ if (cell) {
839
+ cell = cell.dom;
840
+ cellIndex = cell.cellIndex;
841
+ }
842
+ }
843
+
844
+ result = me.fireEvent('uievent', type, me, cell, rowIndex, cellIndex, e, record, row);
845
+
846
+ if (result === false || me.callParent(arguments) === false) {
847
+ return false;
848
+ }
849
+
850
+ // Don't handle cellmouseenter and cellmouseleave events for now
851
+ if (type == 'mouseover' || type == 'mouseout') {
852
+ return true;
853
+ }
854
+
855
+ if(!cell) {
856
+ // if the element whose event is being processed is not an actual cell (for example if using a rowbody
857
+ // feature and the rowbody element's event is being processed) then do not fire any "cell" events
858
+ return true;
859
+ }
860
+
861
+ return !(
862
+ // We are adding cell and feature events
863
+ (me['onBeforeCell' + map[type]](cell, cellIndex, record, row, rowIndex, e) === false) ||
864
+ (me.fireEvent('beforecell' + type, me, cell, cellIndex, record, row, rowIndex, e) === false) ||
865
+ (me['onCell' + map[type]](cell, cellIndex, record, row, rowIndex, e) === false) ||
866
+ (me.fireEvent('cell' + type, me, cell, cellIndex, record, row, rowIndex, e) === false)
867
+ );
868
+ },
869
+
870
+ processSpecialEvent: function(e) {
871
+ var me = this,
872
+ map = me.statics().EventMap,
873
+ features = me.features,
874
+ ln = features.length,
875
+ type = e.type,
876
+ i, feature, prefix, featureTarget,
877
+ beforeArgs, args,
878
+ panel = me.ownerCt;
879
+
880
+ me.callParent(arguments);
881
+
882
+ if (type == 'mouseover' || type == 'mouseout') {
883
+ return;
884
+ }
885
+
886
+ for (i = 0; i < ln; i++) {
887
+ feature = features[i];
888
+ if (feature.hasFeatureEvent) {
889
+ featureTarget = e.getTarget(feature.eventSelector, me.getTargetEl());
890
+ if (featureTarget) {
891
+ prefix = feature.eventPrefix;
892
+ // allows features to implement getFireEventArgs to change the
893
+ // fireEvent signature
894
+ beforeArgs = feature.getFireEventArgs('before' + prefix + type, me, featureTarget, e);
895
+ args = feature.getFireEventArgs(prefix + type, me, featureTarget, e);
896
+
897
+ if (
898
+ // before view event
899
+ (me.fireEvent.apply(me, beforeArgs) === false) ||
900
+ // panel grid event
901
+ (panel.fireEvent.apply(panel, beforeArgs) === false) ||
902
+ // view event
903
+ (me.fireEvent.apply(me, args) === false) ||
904
+ // panel event
905
+ (panel.fireEvent.apply(panel, args) === false)
906
+ ) {
907
+ return false;
908
+ }
909
+ }
910
+ }
911
+ }
912
+ return true;
913
+ },
914
+
915
+ onCellMouseDown: Ext.emptyFn,
916
+ onCellMouseUp: Ext.emptyFn,
917
+ onCellClick: Ext.emptyFn,
918
+ onCellDblClick: Ext.emptyFn,
919
+ onCellContextMenu: Ext.emptyFn,
920
+ onCellKeyDown: Ext.emptyFn,
921
+ onBeforeCellMouseDown: Ext.emptyFn,
922
+ onBeforeCellMouseUp: Ext.emptyFn,
923
+ onBeforeCellClick: Ext.emptyFn,
924
+ onBeforeCellDblClick: Ext.emptyFn,
925
+ onBeforeCellContextMenu: Ext.emptyFn,
926
+ onBeforeCellKeyDown: Ext.emptyFn,
927
+
928
+ /**
929
+ * Expands a particular header to fit the max content width.
930
+ * This will ONLY expand, not contract.
931
+ * @private
932
+ */
933
+ expandToFit: function(header) {
934
+ if (header) {
935
+ var maxWidth = this.getMaxContentWidth(header);
936
+ delete header.flex;
937
+ header.setWidth(maxWidth);
938
+ }
939
+ },
940
+
941
+ /**
942
+ * Returns the max contentWidth of the header's text and all cells
943
+ * in the grid under this header.
944
+ * @private
945
+ */
946
+ getMaxContentWidth: function(header) {
947
+ var cellSelector = header.getCellInnerSelector(),
948
+ cells = this.el.query(cellSelector),
949
+ i = 0,
950
+ ln = cells.length,
951
+ maxWidth = header.el.dom.scrollWidth,
952
+ scrollWidth;
953
+
954
+ for (; i < ln; i++) {
955
+ scrollWidth = cells[i].scrollWidth;
956
+ if (scrollWidth > maxWidth) {
957
+ maxWidth = scrollWidth;
958
+ }
959
+ }
960
+ return maxWidth;
961
+ },
962
+
963
+ getPositionByEvent: function(e) {
964
+ var me = this,
965
+ cellNode = e.getTarget(me.cellSelector),
966
+ rowNode = e.getTarget(me.itemSelector),
967
+ record = me.getRecord(rowNode),
968
+ header = me.getHeaderByCell(cellNode);
969
+
970
+ return me.getPosition(record, header);
971
+ },
972
+
973
+ getHeaderByCell: function(cell) {
974
+ if (cell) {
975
+ var m = cell.className.match(this.cellRe);
976
+ if (m && m[1]) {
977
+ return Ext.getCmp(m[1]);
978
+ }
979
+ }
980
+ return false;
981
+ },
982
+
983
+ /**
984
+ * @param {Object} position The current row and column: an object containing the following properties:
985
+ *
986
+ * - row - The row index
987
+ * - column - The column index
988
+ *
989
+ * @param {String} direction 'up', 'down', 'right' and 'left'
990
+ * @param {Ext.EventObject} e event
991
+ * @param {Boolean} preventWrap Set to true to prevent wrap around to the next or previous row.
992
+ * @param {Function} verifierFn A function to verify the validity of the calculated position.
993
+ * When using this function, you must return true to allow the newPosition to be returned.
994
+ * @param {Object} scope Scope to run the verifierFn in
995
+ * @returns {Object} newPosition An object containing the following properties:
996
+ *
997
+ * - row - The row index
998
+ * - column - The column index
999
+ *
1000
+ * @private
1001
+ */
1002
+ walkCells: function(pos, direction, e, preventWrap, verifierFn, scope) {
1003
+
1004
+ // Caller (probably CellModel) had no current position. This can happen
1005
+ // if the main el is focused and any navigation key is presssed.
1006
+ if (!pos) {
1007
+ return;
1008
+ }
1009
+
1010
+ var me = this,
1011
+ row = pos.row,
1012
+ column = pos.column,
1013
+ rowCount = me.store.getCount(),
1014
+ firstCol = me.getFirstVisibleColumnIndex(),
1015
+ lastCol = me.getLastVisibleColumnIndex(),
1016
+ newPos = {row: row, column: column},
1017
+ activeHeader = me.headerCt.getHeaderAtIndex(column);
1018
+
1019
+ // no active header or its currently hidden
1020
+ if (!activeHeader || activeHeader.hidden) {
1021
+ return false;
1022
+ }
1023
+
1024
+ e = e || {};
1025
+ direction = direction.toLowerCase();
1026
+ switch (direction) {
1027
+ case 'right':
1028
+ // has the potential to wrap if its last
1029
+ if (column === lastCol) {
1030
+ // if bottom row and last column, deny right
1031
+ if (preventWrap || row === rowCount - 1) {
1032
+ return false;
1033
+ }
1034
+ if (!e.ctrlKey) {
1035
+ // otherwise wrap to nextRow and firstCol
1036
+ newPos.row = row + 1;
1037
+ newPos.column = firstCol;
1038
+ }
1039
+ // go right
1040
+ } else {
1041
+ if (!e.ctrlKey) {
1042
+ newPos.column = column + me.getRightGap(activeHeader);
1043
+ } else {
1044
+ newPos.column = lastCol;
1045
+ }
1046
+ }
1047
+ break;
1048
+
1049
+ case 'left':
1050
+ // has the potential to wrap
1051
+ if (column === firstCol) {
1052
+ // if top row and first column, deny left
1053
+ if (preventWrap || row === 0) {
1054
+ return false;
1055
+ }
1056
+ if (!e.ctrlKey) {
1057
+ // otherwise wrap to prevRow and lastCol
1058
+ newPos.row = row - 1;
1059
+ newPos.column = lastCol;
1060
+ }
1061
+ // go left
1062
+ } else {
1063
+ if (!e.ctrlKey) {
1064
+ newPos.column = column + me.getLeftGap(activeHeader);
1065
+ } else {
1066
+ newPos.column = firstCol;
1067
+ }
1068
+ }
1069
+ break;
1070
+
1071
+ case 'up':
1072
+ // if top row, deny up
1073
+ if (row === 0) {
1074
+ return false;
1075
+ // go up
1076
+ } else {
1077
+ if (!e.ctrlKey) {
1078
+ newPos.row = row - 1;
1079
+ } else {
1080
+ newPos.row = 0;
1081
+ }
1082
+ }
1083
+ break;
1084
+
1085
+ case 'down':
1086
+ // if bottom row, deny down
1087
+ if (row === rowCount - 1) {
1088
+ return false;
1089
+ // go down
1090
+ } else {
1091
+ if (!e.ctrlKey) {
1092
+ newPos.row = row + 1;
1093
+ } else {
1094
+ newPos.row = rowCount - 1;
1095
+ }
1096
+ }
1097
+ break;
1098
+ }
1099
+
1100
+ if (verifierFn && verifierFn.call(scope || window, newPos) !== true) {
1101
+ return false;
1102
+ } else {
1103
+ return newPos;
1104
+ }
1105
+ },
1106
+ getFirstVisibleColumnIndex: function() {
1107
+ var firstVisibleHeader = this.getHeaderCt().getVisibleGridColumns()[0];
1108
+
1109
+ return firstVisibleHeader ? firstVisibleHeader.getIndex() : -1;
1110
+ },
1111
+
1112
+ getLastVisibleColumnIndex: function() {
1113
+ var visHeaders = this.getHeaderCt().getVisibleGridColumns(),
1114
+ lastHeader = visHeaders[visHeaders.length - 1];
1115
+
1116
+ return lastHeader.getIndex();
1117
+ },
1118
+
1119
+ getHeaderCt: function() {
1120
+ return this.headerCt;
1121
+ },
1122
+
1123
+ // TODO: have this use the new Ext.grid.CellContext class
1124
+ getPosition: function(record, header) {
1125
+ var me = this,
1126
+ store = me.store,
1127
+ gridCols = me.headerCt.getGridColumns();
1128
+
1129
+ return {
1130
+ row: store.indexOf(record),
1131
+ column: Ext.Array.indexOf(gridCols, header)
1132
+ };
1133
+ },
1134
+
1135
+ /**
1136
+ * Determines the 'gap' between the closest adjacent header to the right
1137
+ * that is not hidden.
1138
+ * @private
1139
+ */
1140
+ getRightGap: function(activeHeader) {
1141
+ var headerCt = this.getHeaderCt(),
1142
+ headers = headerCt.getGridColumns(),
1143
+ activeHeaderIdx = Ext.Array.indexOf(headers, activeHeader),
1144
+ i = activeHeaderIdx + 1,
1145
+ nextIdx;
1146
+
1147
+ for (; i <= headers.length; i++) {
1148
+ if (!headers[i].hidden) {
1149
+ nextIdx = i;
1150
+ break;
1151
+ }
1152
+ }
1153
+
1154
+ return nextIdx - activeHeaderIdx;
1155
+ },
1156
+
1157
+ beforeDestroy: function() {
1158
+ if (this.rendered) {
1159
+ this.el.removeAllListeners();
1160
+ }
1161
+ this.callParent(arguments);
1162
+ },
1163
+
1164
+ /**
1165
+ * Determines the 'gap' between the closest adjacent header to the left
1166
+ * that is not hidden.
1167
+ * @private
1168
+ */
1169
+ getLeftGap: function(activeHeader) {
1170
+ var headerCt = this.getHeaderCt(),
1171
+ headers = headerCt.getGridColumns(),
1172
+ activeHeaderIdx = Ext.Array.indexOf(headers, activeHeader),
1173
+ i = activeHeaderIdx - 1,
1174
+ prevIdx;
1175
+
1176
+ for (; i >= 0; i--) {
1177
+ if (!headers[i].hidden) {
1178
+ prevIdx = i;
1179
+ break;
1180
+ }
1181
+ }
1182
+
1183
+ return prevIdx - activeHeaderIdx;
1184
+ },
1185
+
1186
+ // after adding a row stripe rows from then on
1187
+ onAdd: function(ds, records, index) {
1188
+ this.callParent(arguments);
1189
+ this.doStripeRows(index);
1190
+ },
1191
+
1192
+ // after removing a row stripe rows from then on
1193
+ onRemove: function(ds, records, index) {
1194
+ this.callParent(arguments);
1195
+ this.doStripeRows(index);
1196
+ },
1197
+
1198
+ /**
1199
+ * Stripes rows from a particular row index.
1200
+ * @param {Number} startRow
1201
+ * @param {Number} [endRow] argument specifying the last row to process.
1202
+ * By default process up to the last row.
1203
+ * @private
1204
+ */
1205
+ doStripeRows: function(startRow, endRow) {
1206
+ var me = this,
1207
+ rows,
1208
+ rowsLn,
1209
+ i,
1210
+ row;
1211
+
1212
+ // ensure stripeRows configuration is turned on
1213
+ if (me.rendered && me.stripeRows) {
1214
+ rows = me.getNodes(startRow, endRow);
1215
+
1216
+ for (i = 0, rowsLn = rows.length; i < rowsLn; i++) {
1217
+ row = rows[i];
1218
+ // Remove prior applied row classes.
1219
+ row.className = row.className.replace(me.rowClsRe, ' ');
1220
+ startRow++;
1221
+ // Every odd row will get an additional cls
1222
+ if (startRow % 2 === 0) {
1223
+ row.className += (' ' + me.altRowCls);
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1228
+
1229
+ });