jqgrid_utils 1.4.7 → 1.5.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 +21 -1
- package/dist/jqgrid_utils.js +28 -1
- package/jqgrid_utils.js +28 -1
- package/package.json +1 -1
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#_date112_to_DMY(cell_value, seperator)](#exp_module_Jqgrid_utils--module.exports+_date112_to_DMY) ⏏
|
|
30
31
|
* [module.exports#date112_to_DMY(col_model, edit_field, seperator)](#exp_module_Jqgrid_utils--module.exports+date112_to_DMY) ⏏
|
|
31
32
|
* [module.exports#add_ok_button(col_model, fields)](#exp_module_Jqgrid_utils--module.exports+add_ok_button) ⇒ <code>array</code> ⏏
|
|
32
33
|
* [module.exports#get_filled_cell_table_data(_grid, fields)](#exp_module_Jqgrid_utils--module.exports+get_filled_cell_table_data) ⇒ <code>array</code> ⏏
|
|
@@ -56,6 +57,24 @@ A module for Jqgrid_utils
|
|
|
56
57
|
* [module.exports#set_filter(grid, data, fx, append_to)](#exp_module_Jqgrid_utils--module.exports+set_filter) ⏏
|
|
57
58
|
* [module.exports#_filter()](#exp_module_Jqgrid_utils--module.exports+_filter) ⏏
|
|
58
59
|
|
|
60
|
+
<a name="exp_module_Jqgrid_utils--module.exports+_date112_to_DMY"></a>
|
|
61
|
+
|
|
62
|
+
### module.exports#\_date112\_to\_DMY(cell_value, seperator) ⏏
|
|
63
|
+
Convert a 112 date string to a DMY format with sepertaor - sync function
|
|
64
|
+
|
|
65
|
+
**Kind**: Exported function
|
|
66
|
+
|
|
67
|
+
| Param | Type | Default | Description |
|
|
68
|
+
| --- | --- | --- | --- |
|
|
69
|
+
| cell_value | <code>string</code> | | date string |
|
|
70
|
+
| seperator | <code>string</code> | <code>"/"</code> | seperator used |
|
|
71
|
+
|
|
72
|
+
**Example**
|
|
73
|
+
```js
|
|
74
|
+
var jqu = new Jqgrid_utils();
|
|
75
|
+
let _data = jqu._date112_to_DMY('20220104','/');
|
|
76
|
+
console.log(_data);
|
|
77
|
+
```
|
|
59
78
|
<a name="exp_module_Jqgrid_utils--module.exports+date112_to_DMY"></a>
|
|
60
79
|
|
|
61
80
|
### module.exports#date112\_to\_DMY(col_model, edit_field, seperator) ⏏
|
|
@@ -72,7 +91,7 @@ Convert a 112 date to a DMY format with sepertaor
|
|
|
72
91
|
**Example**
|
|
73
92
|
```js
|
|
74
93
|
var jqu = new Jqgrid_utils();
|
|
75
|
-
let _data = await jqu.
|
|
94
|
+
let _data = await jqu.date112_to_DMY(this,'field','/');
|
|
76
95
|
console.log(_data);
|
|
77
96
|
```
|
|
78
97
|
<a name="exp_module_Jqgrid_utils--module.exports+add_ok_button"></a>
|
|
@@ -440,6 +459,7 @@ Convert a cell into a link/url with data from another cell
|
|
|
440
459
|
```js
|
|
441
460
|
var jqu = new Jqgrid_utils();
|
|
442
461
|
col_model = await jqu.add_link_details(col_model,'http://foo.bar' , 'style','target="_blank"',{'key':'style'});
|
|
462
|
+
col_model = await jqu.add_link_details(col_model, host + '/html/table_size.html' , 'database','target="_blank"',{"database":"database","server":"server"});
|
|
443
463
|
```
|
|
444
464
|
<a name="exp_module_Jqgrid_utils--module.exports+add_link_details_separator"></a>
|
|
445
465
|
|
package/dist/jqgrid_utils.js
CHANGED
|
@@ -22,6 +22,32 @@ module.exports = class Vanilla_website_utils
|
|
|
22
22
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Convert a 112 date string to a DMY format with sepertaor - sync function
|
|
28
|
+
@alias module:Jqgrid_utils
|
|
29
|
+
@param {string} - date string
|
|
30
|
+
@param {string} - seperator used
|
|
31
|
+
@example
|
|
32
|
+
var jqu = new Jqgrid_utils();
|
|
33
|
+
let _data = jqu._date112_to_DMY('20220104','/');
|
|
34
|
+
console.log(_data);
|
|
35
|
+
*/
|
|
36
|
+
_date112_to_DMY(cell_value, seperator='/')
|
|
37
|
+
{
|
|
38
|
+
let value = cell_value;
|
|
39
|
+
if(cell_value.length >= 8 && cell_value.indexOf(seperator) === -1)
|
|
40
|
+
{
|
|
41
|
+
let a = [];
|
|
42
|
+
a.push(cell_value.substr(6, 2));
|
|
43
|
+
a.push(cell_value.substr(4, 2));
|
|
44
|
+
a.push(cell_value.substr(0, 4));
|
|
45
|
+
value = a.join(seperator);
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
25
51
|
/**
|
|
26
52
|
* Convert a 112 date to a DMY format with sepertaor
|
|
27
53
|
@alias module:Jqgrid_utils
|
|
@@ -30,7 +56,7 @@ module.exports = class Vanilla_website_utils
|
|
|
30
56
|
@param {string} - seperator used
|
|
31
57
|
@example
|
|
32
58
|
var jqu = new Jqgrid_utils();
|
|
33
|
-
let _data = await jqu.
|
|
59
|
+
let _data = await jqu.date112_to_DMY(this,'field','/');
|
|
34
60
|
console.log(_data);
|
|
35
61
|
*/
|
|
36
62
|
async date112_to_DMY(col_model, edit_field , seperator='/')
|
|
@@ -600,6 +626,7 @@ async hide_del_icon()
|
|
|
600
626
|
@example
|
|
601
627
|
var jqu = new Jqgrid_utils();
|
|
602
628
|
col_model = await jqu.add_link_details(col_model,'http://foo.bar' , 'style','target="_blank"',{'key':'style'});
|
|
629
|
+
col_model = await jqu.add_link_details(col_model, host + '/html/table_size.html' , 'database','target="_blank"',{"database":"database","server":"server"});
|
|
603
630
|
*/
|
|
604
631
|
async add_link_details(col_model, url, edit_field, attr = '', keys, format)
|
|
605
632
|
{
|
package/jqgrid_utils.js
CHANGED
|
@@ -21,6 +21,32 @@ module.exports = class Vanilla_website_utils
|
|
|
21
21
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Convert a 112 date string to a DMY format with sepertaor - sync function
|
|
27
|
+
@alias module:Jqgrid_utils
|
|
28
|
+
@param {string} - date string
|
|
29
|
+
@param {string} - seperator used
|
|
30
|
+
@example
|
|
31
|
+
var jqu = new Jqgrid_utils();
|
|
32
|
+
let _data = jqu._date112_to_DMY('20220104','/');
|
|
33
|
+
console.log(_data);
|
|
34
|
+
*/
|
|
35
|
+
_date112_to_DMY(cell_value, seperator='/')
|
|
36
|
+
{
|
|
37
|
+
let value = cell_value;
|
|
38
|
+
if(cell_value.length >= 8 && cell_value.indexOf(seperator) === -1)
|
|
39
|
+
{
|
|
40
|
+
let a = [];
|
|
41
|
+
a.push(cell_value.substr(6, 2));
|
|
42
|
+
a.push(cell_value.substr(4, 2));
|
|
43
|
+
a.push(cell_value.substr(0, 4));
|
|
44
|
+
value = a.join(seperator);
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
24
50
|
/**
|
|
25
51
|
* Convert a 112 date to a DMY format with sepertaor
|
|
26
52
|
@alias module:Jqgrid_utils
|
|
@@ -29,7 +55,7 @@ module.exports = class Vanilla_website_utils
|
|
|
29
55
|
@param {string} - seperator used
|
|
30
56
|
@example
|
|
31
57
|
var jqu = new Jqgrid_utils();
|
|
32
|
-
let _data = await jqu.
|
|
58
|
+
let _data = await jqu.date112_to_DMY(this,'field','/');
|
|
33
59
|
console.log(_data);
|
|
34
60
|
*/
|
|
35
61
|
async date112_to_DMY(col_model, edit_field , seperator='/')
|
|
@@ -599,6 +625,7 @@ async hide_del_icon()
|
|
|
599
625
|
@example
|
|
600
626
|
var jqu = new Jqgrid_utils();
|
|
601
627
|
col_model = await jqu.add_link_details(col_model,'http://foo.bar' , 'style','target="_blank"',{'key':'style'});
|
|
628
|
+
col_model = await jqu.add_link_details(col_model, host + '/html/table_size.html' , 'database','target="_blank"',{"database":"database","server":"server"});
|
|
602
629
|
*/
|
|
603
630
|
async add_link_details(col_model, url, edit_field, attr = '', keys, format)
|
|
604
631
|
{
|
package/package.json
CHANGED