jqgrid_utils 1.1.0 → 1.1.1

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.
@@ -24,14 +24,19 @@ module.exports = class Vanilla_website_utils
24
24
  async grid_set_captain(_grid, data=[])
25
25
  {
26
26
  const grid = jQuery(_grid);
27
- if(data.length ===0)
27
+ let count = 0;
28
+ if(data.length === 0)
28
29
  {
29
- data = grid.jqGrid('getRowData');
30
+ count = grid.jqGrid('getGridParam', 'records');
31
+ }
32
+ else
33
+ {
34
+ count = data.length;
30
35
  }
31
36
  let caption = grid.jqGrid("getGridParam", "caption");
32
- if (Array.isArray(data))
37
+ if(caption.indexOf(count+'x') === -1 )
33
38
  {
34
- grid.jqGrid('setCaption', caption + ' - ' + data.length + 'x');
39
+ grid.jqGrid('setCaption', caption + ' - ' + count + 'x');
35
40
  }
36
41
  }
37
42
 
package/jqgrid_utils.js CHANGED
@@ -23,14 +23,19 @@ module.exports = class Vanilla_website_utils
23
23
  async grid_set_captain(_grid, data=[])
24
24
  {
25
25
  const grid = jQuery(_grid);
26
- if(data.length ===0)
26
+ let count = 0;
27
+ if(data.length === 0)
27
28
  {
28
- data = grid.jqGrid('getRowData');
29
+ count = grid.jqGrid('getGridParam', 'records');
30
+ }
31
+ else
32
+ {
33
+ count = data.length;
29
34
  }
30
35
  let caption = grid.jqGrid("getGridParam", "caption");
31
- if (Array.isArray(data))
36
+ if(caption.indexOf(count+'x') === -1 )
32
37
  {
33
- grid.jqGrid('setCaption', caption + ' - ' + data.length + 'x');
38
+ grid.jqGrid('setCaption', caption + ' - ' + count + 'x');
34
39
  }
35
40
  }
36
41
 
package/package.json CHANGED
@@ -28,5 +28,5 @@
28
28
  {
29
29
  "test": "echo \"Error: no test specified\" && exit 1"
30
30
  },
31
- "version": "1.1.0"
31
+ "version": "1.1.1"
32
32
  }