jqgrid_utils 1.4.3 → 1.4.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.
@@ -229,21 +229,24 @@ loadComplete: function(){
229
229
  */
230
230
  async grid_set_caption(_grid, data=[])
231
231
  {
232
- const grid = jQuery(_grid);
233
- let count = 0;
234
- if(data.length === 0)
232
+ if(_grid)
235
233
  {
236
- count = grid.jqGrid('getGridParam', 'records');
237
- }
238
- else
239
- {
240
- count = data.length;
241
- }
242
- let caption = grid.jqGrid("getGridParam", "caption");
243
- const reg = /\d.*x/;
244
- const new_caption = caption.replace(reg, "");
245
- grid.jqGrid('setCaption', new_caption + " " + count + 'x');
234
+ const grid = jQuery(_grid);
235
+ let count = 0;
236
+ if(data.length === 0)
237
+ {
238
+ count = grid.jqGrid('getGridParam', 'records');
239
+ }
240
+ else
241
+ {
242
+ count = data.length;
243
+ }
244
+ let caption = grid.jqGrid("getGridParam", "caption");
245
+ const reg = /\d.*x/;
246
+ const new_caption = caption.replace(reg, "");
247
+ grid.jqGrid('setCaption', new_caption + " " + count + 'x');
246
248
  }
249
+ }
247
250
 
248
251
  /**
249
252
  @alias module:Jqgrid_utils
package/jqgrid_utils.js CHANGED
@@ -228,21 +228,24 @@ loadComplete: function(){
228
228
  */
229
229
  async grid_set_caption(_grid, data=[])
230
230
  {
231
- const grid = jQuery(_grid);
232
- let count = 0;
233
- if(data.length === 0)
231
+ if(_grid)
234
232
  {
235
- count = grid.jqGrid('getGridParam', 'records');
236
- }
237
- else
238
- {
239
- count = data.length;
240
- }
241
- let caption = grid.jqGrid("getGridParam", "caption");
242
- const reg = /\d.*x/;
243
- const new_caption = caption.replace(reg, "");
244
- grid.jqGrid('setCaption', new_caption + " " + count + 'x');
233
+ const grid = jQuery(_grid);
234
+ let count = 0;
235
+ if(data.length === 0)
236
+ {
237
+ count = grid.jqGrid('getGridParam', 'records');
238
+ }
239
+ else
240
+ {
241
+ count = data.length;
242
+ }
243
+ let caption = grid.jqGrid("getGridParam", "caption");
244
+ const reg = /\d.*x/;
245
+ const new_caption = caption.replace(reg, "");
246
+ grid.jqGrid('setCaption', new_caption + " " + count + 'x');
245
247
  }
248
+ }
246
249
 
247
250
  /**
248
251
  @alias module:Jqgrid_utils
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  {
30
30
  "test": "echo \"Error: no test specified\" && exit 1"
31
31
  },
32
- "version": "1.4.3"
32
+ "version": "1.4.4"
33
33
  }