jqgrid_utils 1.8.1 → 1.9.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/dist/jqgrid_utils.js +27 -3
- package/jqgrid_utils.js +27 -3
- package/package.json +1 -1
package/dist/jqgrid_utils.js
CHANGED
|
@@ -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
|
-
|
|
46
|
-
return
|
|
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
|
-
|
|
45
|
-
return
|
|
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