jqgrid_utils 1.5.6 → 1.6.0

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
@@ -27,6 +27,7 @@ A module for Jqgrid_utils
27
27
 
28
28
 
29
29
  * [Jqgrid_utils](#module_Jqgrid_utils)
30
+ * [module.exports#add_textarea(col_model, edit_field)](#exp_module_Jqgrid_utils--module.exports+add_textarea) ⏏
30
31
  * [module.exports#get_col_model_from_data(obj, data, exclude, col_model)](#exp_module_Jqgrid_utils--module.exports+get_col_model_from_data) ⇒ <code>array</code> ⏏
31
32
  * [module.exports#_date112_to_DMY(cell_value, seperator)](#exp_module_Jqgrid_utils--module.exports+_date112_to_DMY) ⏏
32
33
  * [module.exports#date112_to_DMY(col_model, edit_field, seperator)](#exp_module_Jqgrid_utils--module.exports+date112_to_DMY) ⏏
@@ -59,6 +60,24 @@ A module for Jqgrid_utils
59
60
  * [module.exports#set_filter(grid, data, fx, append_to)](#exp_module_Jqgrid_utils--module.exports+set_filter) ⏏
60
61
  * [module.exports#_filter()](#exp_module_Jqgrid_utils--module.exports+_filter) ⏏
61
62
 
63
+ <a name="exp_module_Jqgrid_utils--module.exports+add_textarea"></a>
64
+
65
+ ### module.exports#add\_textarea(col_model, edit_field) ⏏
66
+ add textarea
67
+
68
+ **Kind**: Exported function
69
+
70
+ | Param | Type | Description |
71
+ | --- | --- | --- |
72
+ | col_model | <code>string</code> | edit_filed |
73
+ | edit_field | <code>string</code> | style of the textaread |
74
+
75
+ **Example**
76
+ ```js
77
+ var jqu = new Jqgrid_utils();
78
+ let _data = jqu._date112_to_DMY('20220104','/');
79
+ console.log(_data);
80
+ ```
62
81
  <a name="exp_module_Jqgrid_utils--module.exports+get_col_model_from_data"></a>
63
82
 
64
83
  ### module.exports#get\_col\_model\_from\_data(obj, data, exclude, col_model) ⇒ <code>array</code> ⏏
@@ -22,6 +22,35 @@ module.exports = class Vanilla_website_utils
22
22
 
23
23
  }
24
24
 
25
+
26
+
27
+ /**
28
+ * add textarea
29
+ @alias module:Jqgrid_utils
30
+ @param {string} - edit_filed
31
+ @param {string} - style of the textaread
32
+ @example
33
+ var jqu = new Jqgrid_utils();
34
+ let _data = jqu._date112_to_DMY('20220104','/');
35
+ console.log(_data);
36
+ */
37
+ async add_textarea(col_model, edit_field, style = 'style="width:100%;height:450px"')
38
+ {
39
+ let f = window.sqlFormatter;
40
+ for (let i = 0; i < col_model.length; i++)
41
+ {
42
+ if (col_model[i]['name'] === edit_field)
43
+ {
44
+ col_model[i]['formatter'] = function(cell_val)
45
+ {
46
+ let sql = '<textarea '+ style +'>' + cell_val + '</textarea>' ;
47
+ return sql;
48
+ };
49
+ }
50
+ }
51
+ return col_model;
52
+ }
53
+
25
54
  /**
26
55
  * Get basic colModel data from raw data
27
56
  @alias module:Jqgrid_utils
package/jqgrid_utils.js CHANGED
@@ -21,6 +21,35 @@ module.exports = class Vanilla_website_utils
21
21
 
22
22
  }
23
23
 
24
+
25
+
26
+ /**
27
+ * add textarea
28
+ @alias module:Jqgrid_utils
29
+ @param {string} - edit_filed
30
+ @param {string} - style of the textaread
31
+ @example
32
+ var jqu = new Jqgrid_utils();
33
+ let _data = jqu._date112_to_DMY('20220104','/');
34
+ console.log(_data);
35
+ */
36
+ async add_textarea(col_model, edit_field, style = 'style="width:100%;height:450px"')
37
+ {
38
+ let f = window.sqlFormatter;
39
+ for (let i = 0; i < col_model.length; i++)
40
+ {
41
+ if (col_model[i]['name'] === edit_field)
42
+ {
43
+ col_model[i]['formatter'] = function(cell_val)
44
+ {
45
+ let sql = '<textarea '+ style +'>' + cell_val + '</textarea>' ;
46
+ return sql;
47
+ };
48
+ }
49
+ }
50
+ return col_model;
51
+ }
52
+
24
53
  /**
25
54
  * Get basic colModel data from raw data
26
55
  @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.5.6"
32
+ "version": "1.6.0"
33
33
  }