3
3
4
4
// make sure required JavaScript modules are loaded
5
5
if ( typeof jQuery === "undefined" ) {
6
- throw "Grid requires jquery module to be loaded" ;
6
+ throw "GridView requires jquery to be loaded. " ;
7
7
}
8
8
if ( ! jQuery . fn . drag ) {
9
- throw "Grid requires jquery.event.drag module to be loaded" ;
9
+ throw "GridView requires jquery.event.drag to be loaded. " ;
10
10
}
11
11
if ( typeof Slick === "undefined" ) {
12
- throw "slick. core.js not loaded" ;
12
+ throw "GridView core is not loaded. " ;
13
13
}
14
14
15
15
16
16
// shared across all grids on the page
17
17
var scrollbarDimensions ;
18
18
var maxSupportedCssHeight ; // browser's breaking point
19
19
20
- //////////////////////////////////////////////////////////////////////////////////////////////
21
- // Grid class implementation (available as Slick.Grid)
20
+ // GridView class implementation (available as Slick.GridView)
22
21
23
22
/**
24
23
* Creates a new instance of the grid.
25
- * @class Grid
24
+ * @class GridView
26
25
* @constructor
27
- * @param {Node } container Container node to create the grid in.
28
- * @param {Array,Object } data An array of objects for databinding.
29
- * @param {Array } columns An array of column definitions.
30
- * @param {Object } options Grid options.
26
+ * @param {Object } options GridView options.
31
27
**/
32
- function Grid ( container , data , columns , options ) {
28
+ function GridView ( container , data , columns , options ) {
33
29
// settings
34
30
var defaults = {
35
31
explicitInitialization : false ,
@@ -178,13 +174,10 @@ function Grid(container, data, columns, options) {
178
174
var $hiddenParents ;
179
175
var oldProps = [ ] ;
180
176
181
- //////////////////////////////////////////////////////////////////////////////////////////////
182
- // Initialization
183
-
184
177
function init ( ) {
185
178
$container = $ ( container ) ;
186
179
if ( $container . length < 1 ) {
187
- throw new Error ( "Grid requires a valid container, " + container + " does not exist in the DOM." ) ;
180
+ throw new Error ( "GridView requires a valid container, " + container + " does not exist in the DOM." ) ;
188
181
}
189
182
190
183
cacheCssForHiddenInit ( ) ;
@@ -211,7 +204,7 @@ function Grid(container, data, columns, options) {
211
204
212
205
// validate loaded JavaScript modules against requested options
213
206
if ( options . enableColumnReorder && ! $ . fn . sortable ) {
214
- throw new Error ( "Grid 's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded" ) ;
207
+ throw new Error ( "GridView 's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded" ) ;
215
208
}
216
209
217
210
editController = {
@@ -288,7 +281,7 @@ function Grid(container, data, columns, options) {
288
281
// calculate the diff so we can set consistent sizes
289
282
measureCellPaddingAndBorder ( ) ;
290
283
291
- // for usability reasons, all text selection in Grid is disabled
284
+ // for usability reasons, all text selection in GridView is disabled
292
285
// with the exception of input and textarea elements (selection must
293
286
// be enabled there so that editors work as expected); note that
294
287
// selection in grid cells (grid body) is already unavailable in
@@ -460,7 +453,7 @@ function Grid(container, data, columns, options) {
460
453
var w = canvasWidth + ( viewportHasVScroll ? scrollbarDimensions . width : 0 ) ;
461
454
$headerRowSpacer . width ( w ) ;
462
455
if ( options . createFooterRow ) { $footerRowSpacer . width ( w ) ; }
463
- if ( canvasWidth != oldCanvasWidth || forceColumnWidthsUpdate ) { applyColumnWidths ( ) ;
456
+ if ( canvasWidth != oldCanvasWidth || forceColumnWidthsUpdate ) { applyColumnWidths ( ) ;
464
457
}
465
458
}
466
459
@@ -2829,7 +2822,7 @@ function makeActiveCellEditable(editor) {
2829
2822
return ;
2830
2823
}
2831
2824
if ( ! options . editable ) {
2832
- throw "Grid : makeActiveCellEditable : should never get called when options.editable is false" ;
2825
+ throw "GridView : makeActiveCellEditable : should never get called when options.editable is false" ;
2833
2826
}
2834
2827
2835
2828
// cancel pending async call if there is one
@@ -2941,7 +2934,7 @@ function getActiveCellPosition() {
2941
2934
return absBox ( activeCellNode ) ;
2942
2935
}
2943
2936
2944
- function getGridPosition ( ) {
2937
+ function getGridViewPosition ( ) {
2945
2938
return absBox ( $container [ 0 ] )
2946
2939
}
2947
2940
@@ -3551,7 +3544,7 @@ this.eval = function (expr) {
3551
3544
// Public API
3552
3545
3553
3546
$ . extend ( this , {
3554
- "slickGridVersion " : "2.3.3" ,
3547
+ "slickGridViewVersion " : "2.3.3" ,
3555
3548
3556
3549
// Events
3557
3550
"onScroll" : new Slick . Event ( ) ,
@@ -3661,7 +3654,7 @@ $.extend(this, {
3661
3654
"setFooterRowVisibility" : setFooterRowVisibility ,
3662
3655
"getFooterRow" : getFooterRow ,
3663
3656
"getFooterRowColumn" : getFooterRowColumn ,
3664
- "getGridPosition " : getGridPosition ,
3657
+ "getGridViewPosition " : getGridViewPosition ,
3665
3658
"flashCell" : flashCell ,
3666
3659
"addCellCssStyles" : addCellCssStyles ,
3667
3660
"setCellCssStyles" : setCellCssStyles ,
@@ -3679,5 +3672,5 @@ $.extend(this, {
3679
3672
init ( ) ;
3680
3673
}
3681
3674
3682
- export default Grid ;
3675
+ export default GridView ;
3683
3676
0 commit comments