jqgrid_utils 1.4.1 → 1.4.2

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.
@@ -23,6 +23,44 @@ module.exports = class Vanilla_website_utils
23
23
  }
24
24
 
25
25
 
26
+
27
+
28
+ /**
29
+ * Add an OK Button
30
+ @alias module:Jqgrid_utils
31
+ @param {array} - grid col_model
32
+ @param {array} - list of columns names what will be converted to ok buttons
33
+ @returns {array} - col_model
34
+ @example
35
+ var jqu = new Jqgrid_utils();
36
+ col_model = await jqu.add_ok_button(col_model, ['checked']);
37
+ */
38
+
39
+ async add_ok_button(col_model, fields)
40
+ {
41
+ let self = this;
42
+ for (let i = 0; i < col_model.length; i++)
43
+ {
44
+ if (fields.indexOf(col_model[i]['name']) > -1)
45
+ {
46
+ col_model[i]['formatter'] = function(cell_val)
47
+ {
48
+ if (cell_val != undefined)
49
+ {
50
+ return self.__cell_format(cell_val, 'format_ok');
51
+ }
52
+ else
53
+ {
54
+ return '';
55
+ }
56
+ };
57
+ }
58
+ }
59
+ return col_model;
60
+ }
61
+
62
+
63
+
26
64
  /**
27
65
  * Get the filled cell data
28
66
  @alias module:Jqgrid_utils
@@ -33,7 +71,6 @@ module.exports = class Vanilla_website_utils
33
71
  var jqu = new Jqgrid_utils();
34
72
  col_model = await jqu.set_link(col_model,'av0_code','url_code','target="blank"');
35
73
  */
36
-
37
74
  async get_filled_cell_table_data(_grid, fields=[])
38
75
  {
39
76
  let d = jQuery(_grid).jqGrid('getGridParam','data');
package/jqgrid_utils.js CHANGED
@@ -22,6 +22,44 @@ module.exports = class Vanilla_website_utils
22
22
  }
23
23
 
24
24
 
25
+
26
+
27
+ /**
28
+ * Add an OK Button
29
+ @alias module:Jqgrid_utils
30
+ @param {array} - grid col_model
31
+ @param {array} - list of columns names what will be converted to ok buttons
32
+ @returns {array} - col_model
33
+ @example
34
+ var jqu = new Jqgrid_utils();
35
+ col_model = await jqu.add_ok_button(col_model, ['checked']);
36
+ */
37
+
38
+ async add_ok_button(col_model, fields)
39
+ {
40
+ let self = this;
41
+ for (let i = 0; i < col_model.length; i++)
42
+ {
43
+ if (fields.indexOf(col_model[i]['name']) > -1)
44
+ {
45
+ col_model[i]['formatter'] = function(cell_val)
46
+ {
47
+ if (cell_val != undefined)
48
+ {
49
+ return self.__cell_format(cell_val, 'format_ok');
50
+ }
51
+ else
52
+ {
53
+ return '';
54
+ }
55
+ };
56
+ }
57
+ }
58
+ return col_model;
59
+ }
60
+
61
+
62
+
25
63
  /**
26
64
  * Get the filled cell data
27
65
  @alias module:Jqgrid_utils
@@ -32,7 +70,6 @@ module.exports = class Vanilla_website_utils
32
70
  var jqu = new Jqgrid_utils();
33
71
  col_model = await jqu.set_link(col_model,'av0_code','url_code','target="blank"');
34
72
  */
35
-
36
73
  async get_filled_cell_table_data(_grid, fields=[])
37
74
  {
38
75
  let d = jQuery(_grid).jqGrid('getGridParam','data');
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.1"
32
+ "version": "1.4.2"
33
33
  }