jqgrid_utils 1.2.9 → 1.2.10

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.
package/README.md CHANGED
@@ -62,8 +62,10 @@ A module for Jqgrid_utils
62
62
 
63
63
  * [Jqgrid_utils](#module_Jqgrid_utils)
64
64
  * [module.exports#set_link()](#exp_module_Jqgrid_utils--module.exports+set_link) ⏏
65
- * [module.exports#grid_set_captain()](#exp_module_Jqgrid_utils--module.exports+grid_set_captain) ⏏
65
+ * [module.exports#grid_set_caption(_grid, data)](#exp_module_Jqgrid_utils--module.exports+grid_set_caption) ⏏
66
+ * [module.exports#s_resize_saved_cell_width()](#exp_module_Jqgrid_utils--module.exports+s_resize_saved_cell_width) ⏏
66
67
  * [module.exports#resize_saved_cell_width(col_model, page, grid)](#exp_module_Jqgrid_utils--module.exports+resize_saved_cell_width) ⏏
68
+ * [module.exports#resize_cell(the, column, not)](#exp_module_Jqgrid_utils--module.exports+resize_cell) ⏏
67
69
  * [module.exports#upsert_row()](#exp_module_Jqgrid_utils--module.exports+upsert_row) ⏏
68
70
  * [module.exports#insert_row()](#exp_module_Jqgrid_utils--module.exports+insert_row) ⏏
69
71
  * [module.exports#update_row()](#exp_module_Jqgrid_utils--module.exports+update_row) ⏏
@@ -82,9 +84,26 @@ A module for Jqgrid_utils
82
84
 
83
85
  ### module.exports#set\_link() ⏏
84
86
  **Kind**: Exported function
85
- <a name="exp_module_Jqgrid_utils--module.exports+grid_set_captain"></a>
87
+ <a name="exp_module_Jqgrid_utils--module.exports+grid_set_caption"></a>
86
88
 
87
- ### module.exports#grid\_set\_captain() ⏏
89
+ ### module.exports#grid\_set\_caption(_grid, data) ⏏
90
+ **Kind**: Exported function
91
+
92
+ | Param | Type | Description |
93
+ | --- | --- | --- |
94
+ | _grid | <code>object</code> | gridobject; |
95
+ | data | <code>object</code> | grid data (optional); |
96
+
97
+ **Example**
98
+ ```js
99
+ var jqu = new Jqgrid_utils();
100
+ loadComplete: function(){
101
+ jqu.grid_set_caption(this);
102
+ },
103
+ ```
104
+ <a name="exp_module_Jqgrid_utils--module.exports+s_resize_saved_cell_width"></a>
105
+
106
+ ### module.exports#s\_resize\_saved\_cell\_width() ⏏
88
107
  **Kind**: Exported function
89
108
  <a name="exp_module_Jqgrid_utils--module.exports+resize_saved_cell_width"></a>
90
109
 
@@ -101,6 +120,22 @@ A module for Jqgrid_utils
101
120
  ```js
102
121
  col_model = await jqu.resize_saved_cell_width(col_model);
103
122
  ```
123
+ <a name="exp_module_Jqgrid_utils--module.exports+resize_cell"></a>
124
+
125
+ ### module.exports#resize\_cell(the, column, not) ⏏
126
+ **Kind**: Exported function
127
+
128
+ | Param | Type | Description |
129
+ | --- | --- | --- |
130
+ | the | <code>string</code> | width of the resized column |
131
+ | column | <code>string</code> | number what get resized |
132
+ | not | <code>string</code> | in use yet |
133
+
134
+ **Example**
135
+ ```js
136
+ var jqu = new Jqgrid_utils({page:'mypage'});
137
+ resizeStop: jqu.resize_cell,
138
+ ```
104
139
  <a name="exp_module_Jqgrid_utils--module.exports+upsert_row"></a>
105
140
 
106
141
  ### module.exports#upsert\_row() ⏏
@@ -46,15 +46,22 @@ module.exports = class Vanilla_website_utils
46
46
  }
47
47
 
48
48
 
49
- s_grid_set_captain(_grid, data=[])
49
+ s_grid_set_caption(_grid, data=[])
50
50
  {
51
- this.grid_set_captain(_grid, data=[]);
51
+ this.grid_set_captionn(_grid, data=[]);
52
52
  }
53
53
 
54
54
  /**
55
55
  @alias module:Jqgrid_utils
56
+ @param {object} - gridobject;
57
+ @param {object} - grid data (optional);
58
+ @example
59
+ var jqu = new Jqgrid_utils();
60
+ loadComplete: function(){
61
+ jqu.grid_set_caption(this);
62
+ },
56
63
  */
57
- async grid_set_captain(_grid, data=[])
64
+ async grid_set_caption(_grid, data=[])
58
65
  {
59
66
  const grid = jQuery(_grid);
60
67
  let count = 0;
@@ -67,17 +74,18 @@ module.exports = class Vanilla_website_utils
67
74
  count = data.length;
68
75
  }
69
76
  let caption = grid.jqGrid("getGridParam", "caption");
70
- if(caption.indexOf(count+'x') === -1 )
71
- {
72
- grid.jqGrid('setCaption', caption + ' - ' + count + 'x');
73
- }
77
+ const reg = /\d.*x/;
78
+ const new_caption = caption.replace(reg, "");
79
+ grid.jqGrid('setCaption', new_caption + count + 'x');
74
80
  }
75
81
 
76
-
77
- s_resize_saved_cell_width(col_model, page=false, grid=false)
78
- {
79
- this.grid_set_captain(col_model, page, grid);
80
- }
82
+ /**
83
+ @alias module:Jqgrid_utils
84
+ */
85
+ s_resize_saved_cell_width(col_model, page=false, grid=false)
86
+ {
87
+ this.grid_set_captain(col_model, page, grid);
88
+ }
81
89
 
82
90
 
83
91
  /**
@@ -86,7 +94,7 @@ module.exports = class Vanilla_website_utils
86
94
  @param {string} - the name of the page(optional)
87
95
  @param {object} - the grid objec(optional)
88
96
  @example
89
- * col_model = await jqu.resize_saved_cell_width(col_model);
97
+ col_model = await jqu.resize_saved_cell_width(col_model);
90
98
  */
91
99
  async resize_saved_cell_width(col_model,page=false, grid=false)
92
100
  {
@@ -456,9 +464,9 @@ __cell_format(cell_value, format)
456
464
  @param {object} - col_model for the table
457
465
  @param {string} - Add to the caption of the subgrid
458
466
  @example
459
- * let data_url = api + '/phone_detail?f=data&_id=';
460
- * let col_model_url = api + '/phone_detail?f=col_model';
461
- * let col_model = JSON.parse(await vwu.aget_api(col_model_url))
467
+ let data_url = api + '/phone_detail?f=data&_id=';
468
+ let col_model_url = api + '/phone_detail?f=col_model';
469
+ let col_model = JSON.parse(await vwu.aget_api(col_model_url))
462
470
  */
463
471
  async subgrid(_id, id, data_url, col_model, caption='' )
464
472
  {
@@ -487,7 +495,7 @@ async subgrid(_id, id, data_url, col_model, caption='' )
487
495
  @param {int} - size of the picture
488
496
  @param {bolen} - image path should be a link
489
497
  @example
490
- * col_model = await jqu.add_image(col_model, 'image', 60, false);
498
+ col_model = await jqu.add_image(col_model, 'image', 60, false);
491
499
  */
492
500
  async add_image(col_model, edit_field, size, link=false)
493
501
  {
package/jqgrid_utils.js CHANGED
@@ -45,15 +45,22 @@ module.exports = class Vanilla_website_utils
45
45
  }
46
46
 
47
47
 
48
- s_grid_set_captain(_grid, data=[])
48
+ s_grid_set_caption(_grid, data=[])
49
49
  {
50
- this.grid_set_captain(_grid, data=[]);
50
+ this.grid_set_captionn(_grid, data=[]);
51
51
  }
52
52
 
53
53
  /**
54
54
  @alias module:Jqgrid_utils
55
+ @param {object} - gridobject;
56
+ @param {object} - grid data (optional);
57
+ @example
58
+ var jqu = new Jqgrid_utils();
59
+ loadComplete: function(){
60
+ jqu.grid_set_caption(this);
61
+ },
55
62
  */
56
- async grid_set_captain(_grid, data=[])
63
+ async grid_set_caption(_grid, data=[])
57
64
  {
58
65
  const grid = jQuery(_grid);
59
66
  let count = 0;
@@ -66,17 +73,18 @@ module.exports = class Vanilla_website_utils
66
73
  count = data.length;
67
74
  }
68
75
  let caption = grid.jqGrid("getGridParam", "caption");
69
- if(caption.indexOf(count+'x') === -1 )
70
- {
71
- grid.jqGrid('setCaption', caption + ' - ' + count + 'x');
72
- }
76
+ const reg = /\d.*x/;
77
+ const new_caption = caption.replace(reg, "");
78
+ grid.jqGrid('setCaption', new_caption + count + 'x');
73
79
  }
74
80
 
75
-
76
- s_resize_saved_cell_width(col_model, page=false, grid=false)
77
- {
78
- this.grid_set_captain(col_model, page, grid);
79
- }
81
+ /**
82
+ @alias module:Jqgrid_utils
83
+ */
84
+ s_resize_saved_cell_width(col_model, page=false, grid=false)
85
+ {
86
+ this.grid_set_captain(col_model, page, grid);
87
+ }
80
88
 
81
89
 
82
90
  /**
@@ -85,7 +93,7 @@ module.exports = class Vanilla_website_utils
85
93
  @param {string} - the name of the page(optional)
86
94
  @param {object} - the grid objec(optional)
87
95
  @example
88
- * col_model = await jqu.resize_saved_cell_width(col_model);
96
+ col_model = await jqu.resize_saved_cell_width(col_model);
89
97
  */
90
98
  async resize_saved_cell_width(col_model,page=false, grid=false)
91
99
  {
@@ -455,9 +463,9 @@ __cell_format(cell_value, format)
455
463
  @param {object} - col_model for the table
456
464
  @param {string} - Add to the caption of the subgrid
457
465
  @example
458
- * let data_url = api + '/phone_detail?f=data&_id=';
459
- * let col_model_url = api + '/phone_detail?f=col_model';
460
- * let col_model = JSON.parse(await vwu.aget_api(col_model_url))
466
+ let data_url = api + '/phone_detail?f=data&_id=';
467
+ let col_model_url = api + '/phone_detail?f=col_model';
468
+ let col_model = JSON.parse(await vwu.aget_api(col_model_url))
461
469
  */
462
470
  async subgrid(_id, id, data_url, col_model, caption='' )
463
471
  {
@@ -486,7 +494,7 @@ async subgrid(_id, id, data_url, col_model, caption='' )
486
494
  @param {int} - size of the picture
487
495
  @param {bolen} - image path should be a link
488
496
  @example
489
- * col_model = await jqu.add_image(col_model, 'image', 60, false);
497
+ col_model = await jqu.add_image(col_model, 'image', 60, false);
490
498
  */
491
499
  async add_image(col_model, edit_field, size, link=false)
492
500
  {
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.2.9"
32
+ "version": "1.2.10"
33
33
  }