jqgrid_utils 1.4.2 → 1.4.5

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/.hgignore ADDED
@@ -0,0 +1,17 @@
1
+ syntax: glob
2
+ *~
3
+ .git
4
+ awstats/
5
+ .DS_Store
6
+ *.orig
7
+ .tern-port
8
+ *.mp4
9
+
10
+ *.log
11
+ *~
12
+ ._*
13
+ .tern-port
14
+
15
+ demo/public/node_modules
16
+ syntax: regexp
17
+
package/README.md CHANGED
@@ -1,31 +1,24 @@
1
1
  # Jqgrid_utils
2
2
  Convenient Functions for free jqGrid
3
3
 
4
- Demo:
5
- https://jqgrid_utils.calantas.org
6
-
7
- # Example Usage:
8
-
9
- Add a the library to your website
4
+ # How to install:
5
+ ```bashh
6
+ npm install jqgrid_utils
7
+ ```
10
8
 
9
+ # Usage:
11
10
  ```html
12
11
  <script src="../node_modules/jqgrid_utils/dist/jqgrid_utils.js"></script>
13
12
  ```
14
13
 
15
14
 
16
- Example Usage:
17
- ```javascript
18
-
19
- ```
20
-
21
- Init
22
- * example:
15
+ # Example:
23
16
  ```javascript
24
17
  let jqu = new Jqgrid_utils();
25
18
 
26
19
  ```
27
20
 
28
-
21
+ Source: https://w3.calantas.org/free-dockers/jqgrid_utils/
29
22
 
30
23
  <a name="module_Jqgrid_utils"></a>
31
24
 
@@ -34,6 +27,7 @@ A module for Jqgrid_utils
34
27
 
35
28
 
36
29
  * [Jqgrid_utils](#module_Jqgrid_utils)
30
+ * [module.exports#add_ok_button(col_model, fields)](#exp_module_Jqgrid_utils--module.exports+add_ok_button) ⇒ <code>array</code> ⏏
37
31
  * [module.exports#get_filled_cell_table_data(_grid, fields)](#exp_module_Jqgrid_utils--module.exports+get_filled_cell_table_data) ⇒ <code>array</code> ⏏
38
32
  * [module.exports#get_filled_cell_data(_grid, fields)](#exp_module_Jqgrid_utils--module.exports+get_filled_cell_data) ⇒ <code>object</code> ⏏
39
33
  * [module.exports#set_link(col_model, edit_field, url)](#exp_module_Jqgrid_utils--module.exports+set_link) ⇒ <code>object</code> ⏏
@@ -61,6 +55,24 @@ A module for Jqgrid_utils
61
55
  * [module.exports#set_filter(grid, data, fx, append_to)](#exp_module_Jqgrid_utils--module.exports+set_filter) ⏏
62
56
  * [module.exports#_filter()](#exp_module_Jqgrid_utils--module.exports+_filter) ⏏
63
57
 
58
+ <a name="exp_module_Jqgrid_utils--module.exports+add_ok_button"></a>
59
+
60
+ ### module.exports#add\_ok\_button(col_model, fields) ⇒ <code>array</code> ⏏
61
+ Add an OK Button
62
+
63
+ **Kind**: Exported function
64
+ **Returns**: <code>array</code> - - col_model
65
+
66
+ | Param | Type | Description |
67
+ | --- | --- | --- |
68
+ | col_model | <code>array</code> | grid col_model |
69
+ | fields | <code>array</code> | list of columns names what will be converted to ok buttons |
70
+
71
+ **Example**
72
+ ```js
73
+ var jqu = new Jqgrid_utils();
74
+ col_model = await jqu.add_ok_button(col_model, ['checked']);
75
+ ```
64
76
  <a name="exp_module_Jqgrid_utils--module.exports+get_filled_cell_table_data"></a>
65
77
 
66
78
  ### module.exports#get\_filled\_cell\_table\_data(_grid, fields) ⇒ <code>array</code> ⏏
package/_README.md CHANGED
@@ -1,29 +1,22 @@
1
1
  # Jqgrid_utils
2
2
  Convenient Functions for free jqGrid
3
3
 
4
- Demo:
5
- https://jqgrid_utils.calantas.org
6
-
7
- # Example Usage:
8
-
9
- Add a the library to your website
4
+ # How to install:
5
+ ```bashh
6
+ npm install jqgrid_utils
7
+ ```
10
8
 
9
+ # Usage:
11
10
  ```html
12
11
  <script src="../node_modules/jqgrid_utils/dist/jqgrid_utils.js"></script>
13
12
  ```
14
13
 
15
14
 
16
- Example Usage:
17
- ```javascript
18
-
19
- ```
20
-
21
- Init
22
- * example:
15
+ # Example:
23
16
  ```javascript
24
17
  let jqu = new Jqgrid_utils();
25
18
 
26
19
  ```
27
20
 
28
-
21
+ Source: https://w3.calantas.org/free-dockers/jqgrid_utils/
29
22
 
@@ -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
@@ -785,11 +788,11 @@ __cell_format(cell_value, format)
785
788
  {
786
789
  if (cell_value == 0 || cell_value === 'fail')
787
790
  {
788
- cell_value = '<i class="fa fa-times-circle" aria-hidden="true" style="color:#ff0000;"></i>';
791
+ cell_value = '<i data-check="failed" class="fa fa-times-circle" aria-hidden="true" style="color:#ff0000;"></i>';
789
792
  }
790
793
  else
791
794
  {
792
- cell_value = '<i class="fa fa-check-circle" aria-hidden="true" style="color:#008000;"></i>';
795
+ cell_value = '<i data-check="ok" class="fa fa-check-circle" aria-hidden="true" style="color:#008000;"></i>';
793
796
  }
794
797
  }
795
798
  return cell_value;
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
@@ -784,11 +787,11 @@ __cell_format(cell_value, format)
784
787
  {
785
788
  if (cell_value == 0 || cell_value === 'fail')
786
789
  {
787
- cell_value = '<i class="fa fa-times-circle" aria-hidden="true" style="color:#ff0000;"></i>';
790
+ cell_value = '<i data-check="failed" class="fa fa-times-circle" aria-hidden="true" style="color:#ff0000;"></i>';
788
791
  }
789
792
  else
790
793
  {
791
- cell_value = '<i class="fa fa-check-circle" aria-hidden="true" style="color:#008000;"></i>';
794
+ cell_value = '<i data-check="ok" class="fa fa-check-circle" aria-hidden="true" style="color:#008000;"></i>';
792
795
  }
793
796
  }
794
797
  return cell_value;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  {},
9
9
  "deprecated": false,
10
10
  "description": "Convenient Functions for the Free jqGrid",
11
- "homepage": "http://calantas.org/jqgrid_utils",
11
+ "homepage": "https://w3.calantas.org/free-dockers/jqgrid_utils",
12
12
  "license": "GPL-3.0-or-later",
13
13
  "main": "jqgrid_utils.js",
14
14
  "name": "jqgrid_utils",
@@ -29,5 +29,5 @@
29
29
  {
30
30
  "test": "echo \"Error: no test specified\" && exit 1"
31
31
  },
32
- "version": "1.4.2"
32
+ "version": "1.4.5"
33
33
  }
package/sync_repo.sh ADDED
@@ -0,0 +1,5 @@
1
+ hg clone https://calantas.org/jqgrid_utils
2
+ mv jqgrid_utils/.hg .
3
+ rm jqgrid_utils -Rf
4
+ hg revert .hgignore
5
+