@refinitiv-ui/efx-grid 6.0.1 → 6.0.4

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 (268) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +49 -0
  2. package/lib/column-dragging/es6/ColumnDragging.js +764 -0
  3. package/lib/column-dragging/es6/index.d.ts +1 -0
  4. package/lib/column-dragging/es6/index.js +1 -0
  5. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +13 -1
  6. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
  7. package/lib/column-selection-dialog/lib/column-selection-dialog.js +226 -23
  8. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  9. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  10. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  11. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  12. package/lib/core/dist/core.css +1 -1
  13. package/lib/core/dist/core.js +17835 -16266
  14. package/lib/core/dist/core.min.js +1 -1
  15. package/lib/core/es6/data/ColumnStats.d.ts +2 -2
  16. package/lib/core/es6/data/DataCache.d.ts +4 -4
  17. package/lib/core/es6/data/DataTable.d.ts +5 -5
  18. package/lib/core/es6/data/DataTable.js +33 -11
  19. package/lib/core/es6/data/DataView.d.ts +26 -17
  20. package/lib/core/es6/data/DataView.js +172 -49
  21. package/lib/core/es6/data/Segment.d.ts +2 -0
  22. package/lib/core/es6/data/Segment.js +7 -0
  23. package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
  24. package/lib/core/es6/data/WrappedView.d.ts +289 -0
  25. package/lib/core/es6/data/WrappedView.js +1319 -0
  26. package/lib/core/es6/grid/Core.d.ts +42 -27
  27. package/lib/core/es6/grid/Core.js +431 -163
  28. package/lib/core/es6/grid/ILayoutGrid.d.ts +23 -15
  29. package/lib/core/es6/grid/ILayoutGrid.js +45 -2
  30. package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
  31. package/lib/core/es6/grid/LayoutGrid.js +311 -108
  32. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
  33. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +382 -24
  34. package/lib/core/es6/grid/components/Cell.d.ts +4 -4
  35. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +1 -1
  36. package/lib/core/es6/grid/components/CellSpans.d.ts +8 -8
  37. package/lib/core/es6/grid/components/Column.d.ts +1 -1
  38. package/lib/core/es6/grid/components/Column.js +8 -2
  39. package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
  40. package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
  41. package/lib/core/es6/grid/components/HScrollbar.js +20 -4
  42. package/lib/core/es6/grid/components/Scrollbar.d.ts +1 -1
  43. package/lib/core/es6/grid/components/StretchedCells.js +2 -2
  44. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  45. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +147 -81
  46. package/lib/core/es6/grid/util/Conflator.d.ts +2 -2
  47. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +3 -3
  48. package/lib/core/es6/grid/util/HttpRequest.d.ts +2 -2
  49. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +1 -1
  50. package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
  51. package/lib/core/es6/grid/util/SectionSettings.d.ts +5 -5
  52. package/lib/core/es6/grid/util/SectionSettings.js +5 -0
  53. package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
  54. package/lib/core/es6/grid/util/TrackLayout.d.ts +7 -3
  55. package/lib/core/es6/grid/util/TrackLayout.js +29 -3
  56. package/lib/core/es6/grid/util/util.d.ts +2 -2
  57. package/lib/core/es6/index.d.ts +1 -5
  58. package/lib/core/es6/index.js +1 -7
  59. package/lib/core/es6/tr-grid-theme.js +1 -1
  60. package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
  61. package/lib/filter-dialog/lib/filter-dialog.d.ts +14 -1
  62. package/lib/filter-dialog/lib/filter-dialog.js +94 -32
  63. package/lib/filter-dialog/themes/base-checkbox.less +8 -1
  64. package/lib/filter-dialog/themes/base.less +69 -1
  65. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
  66. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
  67. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
  68. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
  69. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
  70. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
  71. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
  72. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
  73. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
  74. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
  75. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
  76. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
  77. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
  78. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
  79. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
  80. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
  81. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
  82. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
  83. package/lib/grid/lib/efx-grid.d.ts +30 -8
  84. package/lib/grid/lib/efx-grid.js +120 -115
  85. package/lib/grid/themes/base.less +5 -3
  86. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  87. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  88. package/lib/grid/themes/halo/efx-grid.less +72 -41
  89. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  90. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  91. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  92. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  93. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  94. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  95. package/lib/index.d.ts +2 -0
  96. package/lib/index.js +2 -0
  97. package/lib/row-segmenting/es6/RowSegmenting.d.ts +8 -2
  98. package/lib/row-segmenting/es6/RowSegmenting.js +137 -21
  99. package/lib/rt-grid/dist/rt-grid.js +11017 -9193
  100. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  101. package/lib/rt-grid/es6/ColumnDefinition.d.ts +9 -4
  102. package/lib/rt-grid/es6/ColumnDefinition.js +20 -108
  103. package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
  104. package/lib/rt-grid/es6/Grid.d.ts +30 -15
  105. package/lib/rt-grid/es6/Grid.js +436 -167
  106. package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
  107. package/lib/rt-grid/es6/RowDefSorter.js +137 -0
  108. package/lib/rt-grid/es6/RowDefinition.d.ts +12 -7
  109. package/lib/rt-grid/es6/RowDefinition.js +58 -2
  110. package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -1
  111. package/lib/rt-grid/es6/SnapshotFiller.js +23 -0
  112. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
  113. package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
  114. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +6 -3
  115. package/lib/tr-grid-checkbox/es6/Checkbox.js +79 -34
  116. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
  117. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
  118. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
  119. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +269 -10
  120. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
  121. package/lib/tr-grid-column-stack/es6/ColumnStack.js +243 -125
  122. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
  123. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +24 -13
  124. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
  125. package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
  126. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +8 -5
  127. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +106 -3
  128. package/lib/tr-grid-printer/es6/CellWriter.d.ts +3 -3
  129. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +1 -1
  130. package/lib/tr-grid-printer/es6/GridPrinter.js +26 -13
  131. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +2 -2
  132. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +3 -3
  133. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +3 -4
  134. package/lib/tr-grid-row-dragging/es6/RowDragging.js +108 -127
  135. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  136. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
  137. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +7 -2
  138. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +138 -38
  139. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
  140. package/lib/tr-grid-row-selection/es6/RowSelection.js +230 -29
  141. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
  142. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
  143. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -1
  144. package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -0
  145. package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
  146. package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
  147. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  148. package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
  149. package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
  150. package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
  151. package/lib/tr-grid-util/es6/DragUI.d.ts +16 -0
  152. package/lib/tr-grid-util/es6/DragUI.js +214 -0
  153. package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -0
  154. package/lib/tr-grid-util/es6/ElementObserver.js +28 -1
  155. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
  156. package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
  157. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
  158. package/lib/tr-grid-util/es6/ElfUtil.js +1 -1
  159. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
  160. package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
  161. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
  162. package/lib/tr-grid-util/es6/FieldFormatter.js +7 -5
  163. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
  164. package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
  165. package/lib/tr-grid-util/es6/GridPlugin.js +8 -4
  166. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
  167. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +10 -2
  168. package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
  169. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
  170. package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
  171. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  172. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  173. package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
  174. package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
  175. package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
  176. package/lib/tr-grid-util/es6/RowPainter.js +120 -28
  177. package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
  178. package/lib/tr-grid-util/es6/Table.d.ts +13 -13
  179. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
  180. package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
  181. package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
  182. package/lib/tr-grid-util/es6/Util.d.ts +6 -6
  183. package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
  184. package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
  185. package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
  186. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  187. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
  188. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
  189. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  190. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  191. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
  192. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
  193. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
  194. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
  195. package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
  196. package/lib/types/es6/CellSelection.d.ts +1 -1
  197. package/lib/types/es6/Checkbox.d.ts +6 -3
  198. package/lib/types/es6/ColumnGrouping.d.ts +1 -0
  199. package/lib/types/es6/ColumnSelection.d.ts +5 -1
  200. package/lib/types/es6/ColumnStack.d.ts +8 -4
  201. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +3 -2
  202. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +2 -1
  203. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +20 -18
  204. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +2 -1
  205. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +3 -2
  206. package/lib/types/es6/CompositeGrid/Plugin.d.ts +28 -0
  207. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
  208. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +5 -4
  209. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +2 -1
  210. package/lib/types/es6/CompositeGrid/index.d.ts +9 -9
  211. package/lib/types/es6/ConditionalColoring.d.ts +1 -1
  212. package/lib/types/es6/Core/data/ColumnStats.d.ts +2 -2
  213. package/lib/types/es6/Core/data/DataCache.d.ts +4 -4
  214. package/lib/types/es6/Core/data/DataTable.d.ts +5 -5
  215. package/lib/types/es6/Core/data/DataView.d.ts +26 -17
  216. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  217. package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
  218. package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
  219. package/lib/types/es6/Core/grid/Core.d.ts +42 -27
  220. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +23 -15
  221. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
  222. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
  223. package/lib/types/es6/Core/grid/components/Cell.d.ts +4 -4
  224. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +1 -1
  225. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +8 -8
  226. package/lib/types/es6/Core/grid/components/Column.d.ts +1 -1
  227. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +6 -6
  228. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
  229. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +1 -1
  230. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  231. package/lib/types/es6/Core/grid/util/Conflator.d.ts +2 -2
  232. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +3 -3
  233. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +2 -2
  234. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +1 -1
  235. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
  236. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +5 -5
  237. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
  238. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +7 -3
  239. package/lib/types/es6/Core/grid/util/util.d.ts +2 -2
  240. package/lib/types/es6/Core/index.d.ts +1 -5
  241. package/lib/types/es6/ExtensionOptions.d.ts +2 -0
  242. package/lib/types/es6/FilterInput.d.ts +4 -2
  243. package/lib/types/es6/InCellEditing.d.ts +8 -5
  244. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +9 -4
  245. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
  246. package/lib/types/es6/RealtimeGrid/Grid.d.ts +31 -16
  247. package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
  248. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +12 -7
  249. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -1
  250. package/lib/types/es6/RowColoring.d.ts +2 -0
  251. package/lib/types/es6/RowDragging.d.ts +3 -4
  252. package/lib/types/es6/RowFiltering.d.ts +2 -0
  253. package/lib/types/es6/RowGrouping.d.ts +7 -2
  254. package/lib/types/es6/RowSegmenting.d.ts +8 -2
  255. package/lib/types/es6/RowSelection.d.ts +13 -9
  256. package/lib/types/es6/TextFormatting.d.ts +1 -1
  257. package/lib/types/es6/Zoom.d.ts +2 -1
  258. package/lib/types/es6/index.d.ts +3 -0
  259. package/lib/versions.json +22 -21
  260. package/lib/zoom/es6/Zoom.d.ts +2 -1
  261. package/lib/zoom/es6/Zoom.js +11 -4
  262. package/package.json +7 -7
  263. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  264. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +0 -615
  265. package/lib/core/es6/grid/plugins/Plugin.d.ts +0 -28
  266. package/lib/core/es6/grid/plugins/Plugin.js +0 -272
  267. package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  268. package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +0 -28
@@ -26,6 +26,10 @@ var HScrollbar = function () {
26
26
  };
27
27
  Ext.inherits(HScrollbar, Scrollbar);
28
28
 
29
+ /** @type {number}
30
+ * @private
31
+ */
32
+ HScrollbar.prototype._pinnedLeftColumnCount = 0;
29
33
  /** @type {number}
30
34
  * @private
31
35
  */
@@ -45,6 +49,7 @@ HScrollbar.prototype.setScrollContent = function (grid, sections, startColIndex,
45
49
  var sectionCount = sections.length;
46
50
  if(sectionCount <= 0) { return; }
47
51
 
52
+ this._pinnedLeftColumnCount = startColIndex >= 0 ? startColIndex : 0;
48
53
  this._pinnedRightColumnCount = pinnedRightColumn > 0 ? pinnedRightColumn : 0;
49
54
  var section = sections[0];
50
55
  var colCount = section.getColumnCount();
@@ -62,8 +67,6 @@ HScrollbar.prototype.setScrollContent = function (grid, sections, startColIndex,
62
67
  var paneElem = pane.getElement();
63
68
  var sliderElem = paneSlider.getElement();
64
69
 
65
- paneElem.classList.toggle("right-pinning", this._pinnedRightColumnCount ? true : false);
66
-
67
70
  var c;
68
71
  var column;
69
72
  for (c = 0; c < startColIndex; ++c) {
@@ -91,10 +94,10 @@ HScrollbar.prototype.setScrollContent = function (grid, sections, startColIndex,
91
94
  paneSlider.addContent(rs);
92
95
  content.push(rs);
93
96
  }
94
- section._updateRightSpaceStyle(this.isActive() && !this._pinnedRightColumnCount);
97
+ section._updateRightSpaceStyle();
95
98
  }
96
99
  section._updateLayers(); // Order of the layers may be changed due to change in rightspace and/or column pinning
97
- paneSlider._titleSection = section.getElement().classList.contains("title"); // To cache virtualized title section
100
+ paneSlider._titleSection = section.hasClass("title"); // To cache virtualized title section
98
101
  paneSlider._columns = columns; // To cache virtualized columns
99
102
  paneSlider._content = content; // To cache virtualized columns
100
103
  }
@@ -125,6 +128,19 @@ HScrollbar.prototype.setScrollLeft = function (px) {
125
128
  this._scrollTo(px); // "scroll" event may be fired
126
129
  };
127
130
 
131
+ /** @public
132
+ * @return {number}
133
+ */
134
+ HScrollbar.prototype.getPinnedLeftColumnCount = function () {
135
+ return this.isEnabled() ? this._pinnedLeftColumnCount : 0;
136
+ };
137
+ /** @public
138
+ * @return {number}
139
+ */
140
+ HScrollbar.prototype.getPinnedRightColumnCount = function () {
141
+ return this.isEnabled() ? this._pinnedRightColumnCount : 0;
142
+ };
143
+
128
144
  /** @public
129
145
  * @ignore
130
146
  * @param {number} val
@@ -49,7 +49,7 @@ declare class Scrollbar extends ElementWrapper {
49
49
 
50
50
  public setMouseWheelSpeed(val: string): void;
51
51
 
52
- public getDefaultMouseWheelLogic(): ((...params: any[]) => any);
52
+ public getDefaultMouseWheelLogic(): ((...params: any[]) => any)|null;
53
53
 
54
54
  public setScrollingStep(px: number): void;
55
55
 
@@ -160,10 +160,10 @@ StretchedCells.prototype.getColumnIndex = function (cellRef) {
160
160
  if(cellRef["getElement"]) {
161
161
  var cellElement = cellRef["getElement"]();
162
162
  if(cellElement) {
163
- return cellElement._colIndex || 0;
163
+ return cellElement._colIndex != null ? cellElement._colIndex : -1;
164
164
  }
165
165
  } else {
166
- return cellRef._colIndex || 0;
166
+ return cellRef._colIndex != null ? cellRef._colIndex : -1;
167
167
  }
168
168
  }
169
169
  return -1;
@@ -1,5 +1,5 @@
1
1
  import Ext from "../../../../tr-grid-util/es6/Ext.js";
2
- import Plugin from "./Plugin.js";
2
+ import EventDispatcher from "../event/EventDispatcher.js";
3
3
  import Core from "../Core.js";
4
4
  import ILayoutGrid from "../ILayoutGrid.js";
5
5
  import ElementWrapper from "../components/ElementWrapper.js";
@@ -45,10 +45,16 @@ declare namespace SortableTitlePlugin {
45
45
 
46
46
  }
47
47
 
48
- declare class SortableTitlePlugin extends Plugin {
48
+ declare class SortableTitlePlugin extends EventDispatcher {
49
49
 
50
50
  constructor(options?: SortableTitlePlugin.Options);
51
51
 
52
+ public getName(): string;
53
+
54
+ public initialize(host: Core, options?: any): void;
55
+
56
+ public unload(host: Core): void;
57
+
52
58
  public afterInit(): void;
53
59
 
54
60
  public config(options?: any): void;
@@ -57,7 +63,7 @@ declare class SortableTitlePlugin extends Plugin {
57
63
 
58
64
  public getColumnMenu(colIndex: number, config: any): any;
59
65
 
60
- public getIcons(): { [key: string]: string };
66
+ public getIcons(): { [key: string]: string }|null;
61
67
 
62
68
  public setSortLogics(sortLogic: { [key: string]: ((...params: any[]) => any) }): void;
63
69
 
@@ -71,9 +77,11 @@ declare class SortableTitlePlugin extends Plugin {
71
77
 
72
78
  public isColumnSorted(colIndex: number): boolean;
73
79
 
74
- public getSortedColumns(): (any)[] | null;
80
+ public getSortedColumns(): (any)[]|null;
81
+
82
+ public isSorting(): boolean;
75
83
 
76
- public sortColumn(colIndex: number, sortOrder?: string, opt_arg?: any): void;
84
+ public sortColumn(colRef: number|string, sortOrder?: string, opt_arg?: any): void;
77
85
 
78
86
  public sortColumns(sortOptions: (SortableTitlePlugin.InitialSort)[], opt_arg?: any): void;
79
87
 
@@ -85,7 +93,7 @@ declare class SortableTitlePlugin extends Plugin {
85
93
 
86
94
  public setSortableColumnCount(count: number): void;
87
95
 
88
- public getSortingStates(): (any)[];
96
+ public getSortingStates(): (any)[]|null;
89
97
 
90
98
  public updateSortSymbols(): void;
91
99
 
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import Ext from "../../../../tr-grid-util/es6/Ext.js";
3
- import Plugin from "./Plugin.js";
3
+ import EventDispatcher from "../event/EventDispatcher.js";
4
4
  import Core from "../Core.js";
5
5
  import ILayoutGrid from "../ILayoutGrid.js";
6
6
  import ElementWrapper from "../components/ElementWrapper.js";
@@ -40,7 +40,7 @@ import DataTable from "../../data/DataTable.js";
40
40
  */
41
41
 
42
42
  /** @constructor
43
- * @extends {Plugin}
43
+ * @extends {EventDispatcher}
44
44
  * @param {SortableTitlePlugin.Options=} options
45
45
  */
46
46
  var SortableTitlePlugin = function (options) { // TODO: Extract SortableTitlePlugin to grid extension.
@@ -72,7 +72,7 @@ var SortableTitlePlugin = function (options) { // TODO: Extract SortableTitlePlu
72
72
  _t.config({ "sorting": options });
73
73
  }
74
74
  };
75
- Ext.inherits(SortableTitlePlugin, Plugin);
75
+ Ext.inherits(SortableTitlePlugin, EventDispatcher);
76
76
 
77
77
  /**
78
78
  * @typedef {"a" | "ascending" | "d" | "descending" | "n" | null} SortableTitlePlugin~SortOrder
@@ -118,6 +118,12 @@ SortableTitlePlugin.ColumnOptions;
118
118
  */
119
119
  SortableTitlePlugin.Options;
120
120
 
121
+
122
+ /** @type {Array.<Core>}
123
+ * @private
124
+ */
125
+ SortableTitlePlugin.prototype._hosts = null; // For a plug-in that support multi-table
126
+
121
127
  /** Order of item indicates sort priorities used in DataView. <br>
122
128
  * Each state contains column name{string}, sort order {string}, and rendering cell {ElementWrapper}
123
129
  * @private
@@ -222,13 +228,17 @@ var CODE_DOWN = "\u25BC";
222
228
  */
223
229
  var CODE_DIAMOND = "\u25CA";
224
230
 
225
- /** @override */
231
+ /** The name must be readonly and unique among all other plugins
232
+ * @public
233
+ * @return {string}
234
+ */
226
235
  SortableTitlePlugin.prototype.getName = function () {
227
236
  return "SortableTitlePlugin"; // Read Only
228
237
  };
229
238
 
230
- /**
231
- * @override
239
+ /** @public
240
+ * @param {!Core} host
241
+ * @param {Object=} options
232
242
  * @description Suppress google compiler for argument options because Internal Plugin doesn't support.
233
243
  * @suppress {checkTypes}
234
244
  */
@@ -247,7 +257,10 @@ SortableTitlePlugin.prototype.initialize = function (host, options) {
247
257
  this.config(options);
248
258
  };
249
259
 
250
- /** @override */
260
+ /**For disposing any resource
261
+ * @public
262
+ * @param {!Core} host
263
+ */
251
264
  SortableTitlePlugin.prototype.unload = function (host) {
252
265
  var at = this._hosts.indexOf(host);
253
266
  if (at < 0) { return; }
@@ -638,31 +651,18 @@ SortableTitlePlugin.prototype.getSortOrder = function (colIndex) {
638
651
  * @return {number} Return negative value if there is no sorted column
639
652
  */
640
653
  SortableTitlePlugin.prototype.getSortedColumnIndex = function (priority) {
641
- var state = this._sortStates[priority || 0];
642
- if (state) {
643
- var host = this._hosts[0];
644
- var colCount = host ? host.getColumnCount() : 0;
645
- for (var c = 0; c < colCount; ++c) {
646
- var sortOptions = this._getSortOptions(c);
647
- if (sortOptions === state) {
648
- return c;
649
- }
650
- }
651
- }
652
- return -1;
654
+ return this._getColumnIndexByOptions(this._sortStates[priority || 0]);
653
655
  };
654
- /** @public
656
+ /** Start with 0 (the first column that is being sorted). The highest number will be sorted last. Negative value means the specified column is not sorted
657
+ * @public
655
658
  * @param {number} colIndex
656
- * @return {number} Start with 0 (first column to be sorted) and end in the highest number. Negative means the specified column is not sorted
659
+ * @return {number}
657
660
  */
658
661
  SortableTitlePlugin.prototype.getSortPriority = function (colIndex) {
659
- var sortOptions = this._getSortOptions(colIndex);
660
- if (sortOptions && sortOptions["sortOrder"]) {
661
- var len = this._sortStates.length;
662
- for (var i = 0; i < len; ++i) {
663
- if (this._sortStates[i] === sortOptions) {
664
- return i;
665
- }
662
+ var len = this._sortStates.length;
663
+ for (var i = 0; i < len; ++i) {
664
+ if (this._sortStates[i] === this._getSortOptions(colIndex)) {
665
+ return i;
666
666
  }
667
667
  }
668
668
  return -1;
@@ -675,7 +675,7 @@ SortableTitlePlugin.prototype.isColumnSorted = function (colIndex) {
675
675
  return this.getSortPriority(colIndex) >= 0;
676
676
  };
677
677
  /** @public
678
- * @return {Array.<Object> | null} Array of object with "colIndex" and "sortOrder"
678
+ * @return {Array.<Object>} Array of object with "colIndex" and "sortOrder"
679
679
  */
680
680
  SortableTitlePlugin.prototype.getSortedColumns = function () {
681
681
  var len = this._sortStates.length;
@@ -684,28 +684,33 @@ SortableTitlePlugin.prototype.getSortedColumns = function () {
684
684
  var arr = new Array(len);
685
685
  for (var i = 0; i < len; ++i) {
686
686
  var colIndex = this.getSortedColumnIndex(i);
687
+ var state = this._sortStates[i];
687
688
  arr[i] = {
688
689
  "colIndex": colIndex,
689
- "sortOrder": this._sortStates[i]["sortOrder"] || "n"
690
+ "field": state["field"] || "",
691
+ "sortOrder": state["sortOrder"] || "n"
690
692
  };
691
693
  }
692
694
  return arr;
693
695
  };
696
+ /** @public
697
+ * @return {boolean}
698
+ */
699
+ SortableTitlePlugin.prototype.isSorting = function () {
700
+ return this._sortStates.length ? true : false;
701
+ };
694
702
 
695
703
  /** @public
696
- * @param {number} colIndex
704
+ * @param {number|string} colRef Column index or field
697
705
  * @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
698
706
  * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
699
707
  * @fires SortableTitlePlugin#preDataSorting
700
708
  * @fires SortableTitlePlugin#columnSorted
701
709
  */
702
- SortableTitlePlugin.prototype.sortColumn = function (colIndex, sortOrder, opt_arg) {
703
- if (colIndex >= 0) { // ColIndex can be greater than the host column count, to allow default sorting
704
-
705
- var state = this._preSortColumn(colIndex, sortOrder);
706
- if (state) {
707
- this._sortColumn([state], opt_arg);
708
- }
710
+ SortableTitlePlugin.prototype.sortColumn = function (colRef, sortOrder, opt_arg) {
711
+ var state = this._prepareSorting(colRef, sortOrder);
712
+ if (state) {
713
+ this._sortColumn([state], opt_arg);
709
714
  }
710
715
  };
711
716
 
@@ -721,7 +726,14 @@ SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
721
726
  var states = [];
722
727
  for (var i = 0; i < sortOptions.length; i++) {
723
728
  var opt = sortOptions[i];
724
- var state = this._preSortColumn(opt["colIndex"], opt["sortOrder"] || opt["order"]);
729
+ var colRef = opt["colIndex"];
730
+ if(colRef < 0 || colRef == null) {
731
+ colRef = opt["field"];
732
+ }
733
+ var state = this._prepareSorting(
734
+ colRef,
735
+ opt["sortOrder"] || opt["order"]
736
+ );
725
737
  if (state) {
726
738
  states[i] = state;
727
739
  }
@@ -750,7 +762,6 @@ SortableTitlePlugin.prototype.refresh = function () {
750
762
 
751
763
  /** @description Perform sorting with the same parameter. Alias to {@link SortableTitlePlugin#refresh}
752
764
  * @public
753
- * @override
754
765
  * @function
755
766
  */
756
767
  SortableTitlePlugin.prototype.restoreUserActions = SortableTitlePlugin.prototype.refresh;
@@ -818,20 +829,24 @@ SortableTitlePlugin.prototype.setDataColumnNames = SortableTitlePlugin.prototype
818
829
  * @return {string} field A field used for sorting
819
830
  */
820
831
  SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
821
- var options = this._getSortOptions(colIndex);
832
+ var sortOptions = this._getSortOptions(colIndex);
822
833
  // options["field"] is already consolidated from field, sortBy, and sortable properties.
823
- var field = (options) ? options["field"] : null;
834
+ var field = (sortOptions) ? sortOptions["field"] : null;
824
835
 
825
- if (field == null && !this._rowDefMode) { // Old CompositeGrid may stored sorting field in DataColumnName
836
+ if (field == null && !this._rowDefMode) { // Old CompositeGrid may store sorting field in DataColumnName
826
837
  var host = this._hosts[0];
827
838
  if (host) {
828
839
  field = host.getDataColumnName(colIndex);
840
+ if(field && sortOptions) {
841
+ sortOptions["field"] = field; // Cache for later use
842
+ }
829
843
  }
830
844
  }
831
845
 
832
846
  return field || "";
833
847
  };
834
- /** @public
848
+ /** This is equivalent to setting sortBy in the configuration object.
849
+ * @public
835
850
  * @param {number} colIndex
836
851
  * @param {string|null} field A field used for sorting
837
852
  * @param {Function=} sortLogic
@@ -852,21 +867,26 @@ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field,
852
867
  }
853
868
  }
854
869
  };
855
- /** @public
870
+ /** Return array of the fields from the currently sorted columns
871
+ * @public
856
872
  * @return {!Array.<string>} fields of each sorting states
857
873
  */
858
874
  SortableTitlePlugin.prototype.getColumnSortingFields = function () {
859
- var ary = [];
875
+ var len = this._sortStates.length;
876
+ var ary = new Array(len);
860
877
  var host = this._hosts[0];
861
- var colCount = host ? host.getColumnCount() : 0;
862
- for (var c = 0; c < colCount; ++c) {
863
- var sortOptions = this._getSortOptions(c);
864
- if (sortOptions && sortOptions["sortOrder"]) {
865
- var priority = this._sortStates.indexOf(sortOptions);
866
- if (priority >= 0) {
867
- ary[priority] = this.getColumnSortingField(c);
878
+
879
+ for(var i = 0; i < len; ++i) {
880
+ var sortOptions = this._sortStates[i];
881
+ var field = sortOptions["field"];
882
+ if(!field && !this._rowDefMode) {
883
+ var colIndex = this._getColumnIndexByOptions(sortOptions); // Slow
884
+ field = host.getDataColumnName(colIndex);
885
+ if(field) {
886
+ sortOptions["field"] = field; // Cache for later use
868
887
  }
869
888
  }
889
+ ary[i] = field || "";
870
890
  }
871
891
  return ary;
872
892
  };
@@ -1110,7 +1130,7 @@ SortableTitlePlugin.prototype._proceedSorting = function (hitObj) {
1110
1130
  if (this._canClickToSort(hitObj)) {
1111
1131
  var colIndex = hitObj["colIndex"];
1112
1132
  // _proceedSorting() method is always produced by user clicking at the header // Thus, this operation is guaranteed to be a user action
1113
- var state = this._preSortColumn(colIndex);
1133
+ var state = this._prepareSorting(colIndex);
1114
1134
  if (state) {
1115
1135
  this._sortColumn([state], { "isUserAction": true });
1116
1136
  }
@@ -1134,6 +1154,14 @@ SortableTitlePlugin.prototype._onMouseDown = function (e) {
1134
1154
  }
1135
1155
  };
1136
1156
  /** @private
1157
+ * @param {string} pluginName
1158
+ * @return {*|null}
1159
+ */
1160
+ SortableTitlePlugin.prototype._getPlugin = function(pluginName) {
1161
+ var host = this._hosts[0];
1162
+ return (host) ? host.getPlugin(pluginName) : null;
1163
+ };
1164
+ /** @private
1137
1165
  * @param {Core} grid
1138
1166
  * @param {MouseEvent} e
1139
1167
  */
@@ -1288,23 +1316,36 @@ SortableTitlePlugin.prototype.clearAllColumnSortingSequences = function () {
1288
1316
 
1289
1317
 
1290
1318
  /** @private
1291
- * @param {number} colIndex
1319
+ * @param {number|string} colRef Column index or field
1292
1320
  * @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
1293
1321
  * @returns {Object} state Returns null, if nothing is changed
1294
1322
  */
1295
- SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
1296
- if (!this._maxCount) { return null; }
1323
+ SortableTitlePlugin.prototype._prepareSorting = function (colRef, sortOrder) {
1324
+ if (!this._maxCount) {
1325
+ return null;
1326
+ }
1297
1327
 
1298
- var priority = this.getSortPriority(colIndex);
1299
- var curState = (priority >= 0) ? this._sortStates[priority] : null;
1328
+ var colIndex = -1;
1329
+ var field = "";
1330
+ var priority = -1;
1331
+ if(typeof colRef === "number") {
1332
+ colIndex = colRef;
1333
+ field = this.getColumnSortingField(colIndex);
1334
+ priority = this.getSortPriority(colIndex);
1335
+ } else if(typeof colRef === "string") {
1336
+ field = colRef;
1337
+ colIndex = this._getColumnIndexByField(field);
1338
+ var fields = this.getColumnSortingFields();
1339
+ priority = fields.indexOf(field);
1340
+ }
1300
1341
 
1342
+ var curState = (priority >= 0) ? this._sortStates[priority] : null;
1301
1343
  var curOrder = curState ? curState["sortOrder"] : "n";
1302
1344
 
1303
1345
  // Getting next sort order
1304
1346
  var nextOrder = "n";
1305
- var sortingField = this.getColumnSortingField(colIndex);
1306
1347
  if (sortOrder == null) { // Auto order switch
1307
- var sortingSequence = this.getSortingSequence(sortingField);
1348
+ var sortingSequence = this.getSortingSequence(field);
1308
1349
 
1309
1350
  var sequenceIndex = sortingSequence.indexOf(curOrder);
1310
1351
  if (sequenceIndex < 0) {
@@ -1329,10 +1370,16 @@ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
1329
1370
  }
1330
1371
 
1331
1372
  if (nextOrder === "a" || nextOrder === "d") { // Reorder sort states
1373
+ if(colIndex < 0 && !field) {
1374
+ return null;
1375
+ }
1332
1376
  if (!curState) {
1333
1377
  // TODO: Sort state object should not be sortOptions
1334
1378
  curState = this._newSortOptions(colIndex); // This may come with sortLogic
1335
1379
  }
1380
+ if(colIndex < 0) {
1381
+ curState["field"] = field;
1382
+ }
1336
1383
 
1337
1384
  this._sortStates.push(curState); // Latest sorting have lowest priority (multiColumn sorting)
1338
1385
  }
@@ -1359,7 +1406,7 @@ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
1359
1406
 
1360
1407
  return { // TODO: Refactor this code as it is only used by "columnSorted" event (unnecessarily complex).
1361
1408
  "colIndex": colIndex,
1362
- "sortedField": sortingField,
1409
+ "sortedField": field,
1363
1410
  "sortOrder": nextOrder || "n",
1364
1411
  "prevOrder": curOrder,
1365
1412
  "clearedSortColIndexes": clearedSortColIndexes
@@ -1367,7 +1414,7 @@ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
1367
1414
  };
1368
1415
 
1369
1416
  /** @private
1370
- * @param {Array.<Object>} states States from _preSortColumn for dispatching columnSorted event.
1417
+ * @param {Array.<Object>} states States from _prepareSorting for dispatching columnSorted event.
1371
1418
  * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
1372
1419
  * @fires SortableTitlePlugin#preDataSorting
1373
1420
  * @fires SortableTitlePlugin#columnSorted
@@ -1394,8 +1441,8 @@ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
1394
1441
  this._dispatch("columnSorted", res);
1395
1442
  };
1396
1443
 
1397
- /** @override
1398
- * @ignore
1444
+ /** @private
1445
+ * @param {Object} e
1399
1446
  */
1400
1447
  SortableTitlePlugin.prototype._onColumnAdded = function (e) {
1401
1448
  var t = this;
@@ -1417,8 +1464,8 @@ SortableTitlePlugin.prototype._onColumnAdded = function (e) {
1417
1464
  }
1418
1465
  };
1419
1466
 
1420
- /** @override
1421
- * @ignore
1467
+ /** @private
1468
+ * @param {Object} e
1422
1469
  * @fires SortableTitlePlugin#preDataSorting
1423
1470
  * @fires SortableTitlePlugin#columnSorted
1424
1471
  */
@@ -1470,7 +1517,7 @@ SortableTitlePlugin.prototype._sortDataView = function (opt_action) {
1470
1517
  sortLogics = new Array(sortCount);
1471
1518
  for (var i = 0; i < sortCount; ++i) {
1472
1519
  orders[i] = this._sortStates[i]["sortOrder"];
1473
- sortLogics[i] = this._sortStates[i]["sortLogic"];
1520
+ sortLogics[i] = this._sortStates[i]["sortLogic"]; // sortLogic can be null
1474
1521
  }
1475
1522
  if(this._rowDefMode) { // DataView in real-time grid has only ROW_DEF column
1476
1523
  c_ref = this._sortStates.map(SortableTitlePlugin._toRowDefField);
@@ -1552,7 +1599,7 @@ SortableTitlePlugin.prototype._updateSortableIndicator = function (hostIndex) {
1552
1599
 
1553
1600
  cell["addClass"]("sortable");
1554
1601
 
1555
- var priority = t._getColumnSortingStatePriority(col);
1602
+ var priority = t.getSortPriority(col);
1556
1603
  var state = t._sortStates[priority];
1557
1604
 
1558
1605
  var isSorting = state && state["sortOrder"] !== "n";
@@ -1623,18 +1670,40 @@ SortableTitlePlugin.prototype._createIconElem = function (icon, fallback) {
1623
1670
  };
1624
1671
 
1625
1672
  /** @private
1626
- * @param {number} colIndex
1627
- * @return {number} -1 means not found
1673
+ * @param {Object} sortOptions
1674
+ * @return {number}
1628
1675
  */
1629
- SortableTitlePlugin.prototype._getColumnSortingStatePriority = function (colIndex) {
1630
- var t = this;
1631
- for (var i = t._sortStates.length; --i >= 0;) {
1632
- var col = t.getSortedColumnIndex(i);
1633
- if (col === colIndex) return i;
1676
+ SortableTitlePlugin.prototype._getColumnIndexByOptions = function (sortOptions) {
1677
+ if(sortOptions) {
1678
+ var host = this._hosts[0];
1679
+ var colCount = host ? host.getColumnCount() : 0;
1680
+ for (var c = 0; c < colCount; ++c) {
1681
+ var colData = host.getColumnData(c); // Equivalent to _getSortOptions() method
1682
+ if (colData) {
1683
+ if(sortOptions === colData["sortableTitle"]) {
1684
+ return c;
1685
+ }
1686
+ }
1687
+ }
1688
+ }
1689
+ return -1;
1690
+ };
1691
+ /** @private
1692
+ * @param {string} field
1693
+ * @return {number}
1694
+ */
1695
+ SortableTitlePlugin.prototype._getColumnIndexByField = function (field) {
1696
+ if(field) {
1697
+ var host = this._hosts[0];
1698
+ var colCount = host ? host.getColumnCount() : 0;
1699
+ for (var c = 0; c < colCount; ++c) {
1700
+ if(field === this.getColumnSortingField(c)) {
1701
+ return c;
1702
+ }
1703
+ }
1634
1704
  }
1635
1705
  return -1;
1636
1706
  };
1637
-
1638
1707
  /** @private
1639
1708
  * @param {number} colIndex
1640
1709
  * @return {Object}
@@ -1657,10 +1726,7 @@ SortableTitlePlugin.prototype._newSortOptions = function (colIndex) {
1657
1726
  var host = this._hosts[0];
1658
1727
  var sortOptions = null;
1659
1728
  if (host && colIndex >= 0) {
1660
- var colData = host.getColumnData(colIndex);
1661
- if (!colData) {
1662
- colData = host.setColumnData(colIndex, {});
1663
- }
1729
+ var colData = host.getColumnData(colIndex); // colData is guaranteed to exist
1664
1730
  sortOptions = colData["sortableTitle"];
1665
1731
  if (!sortOptions) {
1666
1732
  sortOptions = colData["sortableTitle"] = {};
@@ -4,9 +4,9 @@ declare class Conflator {
4
4
 
5
5
  constructor(opt_func?: ((...params: any[]) => any)|number, opt_ms?: number|((...params: any[]) => any), opt_thisObj?: any);
6
6
 
7
- public reset(): any[];
7
+ public reset(): any[]|null;
8
8
 
9
- public popAllData(): any[];
9
+ public popAllData(): any[]|null;
10
10
 
11
11
  public dispose(): void;
12
12
 
@@ -6,11 +6,11 @@ declare namespace ElementFrameWork {
6
6
 
7
7
  function isElfv3(): boolean;
8
8
 
9
- function createIcon(iconName: string): Element;
9
+ function createIcon(iconName: string): Element|null;
10
10
 
11
- function createIconButton(iconName: string): Element;
11
+ function createIconButton(iconName: string): Element|null;
12
12
 
13
- function createRangeBar(): Element;
13
+ function createRangeBar(): Element|null;
14
14
 
15
15
  }
16
16
 
@@ -17,7 +17,7 @@ declare class HttpRequest extends EventDispatcher {
17
17
 
18
18
  public getState(): string;
19
19
 
20
- public getResponse(): any|string;
20
+ public getResponse(): any|string|null;
21
21
 
22
22
  public getResponseText(): string;
23
23
 
@@ -27,7 +27,7 @@ declare class HttpRequest extends EventDispatcher {
27
27
 
28
28
  public setRequestTimeout(timeout: number): void;
29
29
 
30
- public valueOf(): any|string;
30
+ public valueOf(): any|string|null;
31
31
 
32
32
  public toString(): string;
33
33
 
@@ -9,7 +9,7 @@ declare class PercentBarRenderer {
9
9
 
10
10
  public render(cell: ElementWrapper, value: number, opt_max?: number, opt_displayText?: string, opt_textWidth?: number): void;
11
11
 
12
- public renderForPrinting(cell: ElementWrapper, value: number, opt_max?: number): PercentBar;
12
+ public renderForPrinting(cell: ElementWrapper, value: number, opt_max?: number): PercentBar|null;
13
13
 
14
14
  public setAlignment(alignment: string): void;
15
15
 
@@ -7,7 +7,7 @@ declare class RangeBar extends ElementWrapper {
7
7
 
8
8
  constructor(opt_element?: Element);
9
9
 
10
- public static getControl(obj: any): RangeBar;
10
+ public static getControl(obj: any): RangeBar|null;
11
11
 
12
12
  public getPercent(): number;
13
13