jqgrid_utils 1.8.1 → 1.9.1

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_edit(col_model)](#exp_module_Jqgrid_utils--module.exports+add_edit) ⏏
30
31
  * [module.exports#add_textarea(col_model, edit_field)](#exp_module_Jqgrid_utils--module.exports+add_textarea) ⏏
31
32
  * [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> ⏏
32
33
  * [module.exports#binary_replace(cell_value, a, b)](#exp_module_Jqgrid_utils--module.exports+binary_replace) ⏏
@@ -62,6 +63,24 @@ A module for Jqgrid_utils
62
63
  * [module.exports#set_filter(grid, data, fx, append_to)](#exp_module_Jqgrid_utils--module.exports+set_filter) ⏏
63
64
  * [module.exports#_filter()](#exp_module_Jqgrid_utils--module.exports+_filter) ⏏
64
65
 
66
+ <a name="exp_module_Jqgrid_utils--module.exports+add_edit"></a>
67
+
68
+ ### module.exports#add\_edit(col_model) ⏏
69
+ add textarea
70
+
71
+ **Kind**: Exported function
72
+
73
+ | Param | Type | Description |
74
+ | --- | --- | --- |
75
+ | col_model | <code>object</code> | edittype like |
76
+
77
+ **Example**
78
+ ```js
79
+ let col_model = JSON.parse(await aget_api(url + "/model"));
80
+ col_model = await jqu.add_edit(col_model, 'mon',{ edittype:'textarea', editoptions:{rows:6,cols:100} });
81
+ see for other inputfields:
82
+ http://www.trirand.com/blog/phpjqgrid/doc/_2v80w6oam.htm
83
+ ```
65
84
  <a name="exp_module_Jqgrid_utils--module.exports+add_textarea"></a>
66
85
 
67
86
  ### module.exports#add\_textarea(col_model, edit_field) ⏏
@@ -23,7 +23,30 @@ module.exports = class Vanilla_website_utils
23
23
  }
24
24
 
25
25
 
26
+ /**
27
+ * add textarea
28
+ @alias module:Jqgrid_utils
29
+ @param {object} - edittype like
30
+ @example
31
+ let col_model = JSON.parse(await aget_api(url + "/model"));
32
+ col_model = await jqu.add_edit(col_model, 'mon',{ edittype:'textarea', editoptions:{rows:6,cols:100} });
33
+ see for other inputfields:
34
+ http://www.trirand.com/blog/phpjqgrid/doc/_2v80w6oam.htm
35
+ */
36
+ async add_edit(col_model, edit_field, edittype, editoptions)
37
+ {
38
+ for (let i = 0; i < col_model.length; i++)
39
+ {
40
+ if (col_model[i]['name'] === edit_field)
41
+ {
42
+ Object.assign(col_model[i], edittype );
43
+ Object.assign(col_model[i], editoptions );
44
+ }
45
+ }
46
+ return col_model;
47
+ }
26
48
 
49
+
27
50
  /**
28
51
  * add textarea
29
52
  @alias module:Jqgrid_utils
@@ -35,20 +58,21 @@ col_model = await jqu.add_textarea(col_model, 'worker','style="width:100%;height
35
58
  */
36
59
  async add_textarea(col_model, edit_field, style = 'style="width:100%;height:100px"')
37
60
  {
38
- let f = window.sqlFormatter;
39
61
  for (let i = 0; i < col_model.length; i++)
40
62
  {
41
63
  if (col_model[i]['name'] === edit_field)
42
64
  {
43
65
  col_model[i]['formatter'] = function(cell_val)
44
66
  {
45
- let sql = '<textarea '+ style +'>' + cell_val + '</textarea>' ;
46
- return sql;
67
+ const txt = '<textarea '+ style +'>' + cell_val + '</textarea>' ;
68
+ return txt;
47
69
  };
48
70
  }
49
71
  }
50
72
  return col_model;
51
73
  }
74
+
75
+
52
76
 
53
77
  /**
54
78
  * Get basic colModel data from raw data
package/jqgrid_utils.js CHANGED
@@ -22,7 +22,30 @@ module.exports = class Vanilla_website_utils
22
22
  }
23
23
 
24
24
 
25
+ /**
26
+ * add textarea
27
+ @alias module:Jqgrid_utils
28
+ @param {object} - edittype like
29
+ @example
30
+ let col_model = JSON.parse(await aget_api(url + "/model"));
31
+ col_model = await jqu.add_edit(col_model, 'mon',{ edittype:'textarea', editoptions:{rows:6,cols:100} });
32
+ see for other inputfields:
33
+ http://www.trirand.com/blog/phpjqgrid/doc/_2v80w6oam.htm
34
+ */
35
+ async add_edit(col_model, edit_field, edittype, editoptions)
36
+ {
37
+ for (let i = 0; i < col_model.length; i++)
38
+ {
39
+ if (col_model[i]['name'] === edit_field)
40
+ {
41
+ Object.assign(col_model[i], edittype );
42
+ Object.assign(col_model[i], editoptions );
43
+ }
44
+ }
45
+ return col_model;
46
+ }
25
47
 
48
+
26
49
  /**
27
50
  * add textarea
28
51
  @alias module:Jqgrid_utils
@@ -34,20 +57,21 @@ col_model = await jqu.add_textarea(col_model, 'worker','style="width:100%;height
34
57
  */
35
58
  async add_textarea(col_model, edit_field, style = 'style="width:100%;height:100px"')
36
59
  {
37
- let f = window.sqlFormatter;
38
60
  for (let i = 0; i < col_model.length; i++)
39
61
  {
40
62
  if (col_model[i]['name'] === edit_field)
41
63
  {
42
64
  col_model[i]['formatter'] = function(cell_val)
43
65
  {
44
- let sql = '<textarea '+ style +'>' + cell_val + '</textarea>' ;
45
- return sql;
66
+ const txt = '<textarea '+ style +'>' + cell_val + '</textarea>' ;
67
+ return txt;
46
68
  };
47
69
  }
48
70
  }
49
71
  return col_model;
50
72
  }
73
+
74
+
51
75
 
52
76
  /**
53
77
  * Get basic colModel data from raw 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.8.1"
32
+ "version": "1.9.1"
33
33
  }