jqgrid_utils 1.2.8 → 1.2.11
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 +41 -31
- package/_README.md +3 -28
- package/dist/jqgrid_utils.js +25 -19
- package/jqgrid_utils.js +25 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,39 +20,14 @@ Example Usage:
|
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* To add the Qty of rows to the Caption text
|
|
26
|
-
* grid_set_captain(_grid, data)
|
|
27
|
-
* _grid: the DOM ID of grid(type: string), example: '#grid'
|
|
28
|
-
* data: the grid data(type: array) (Optional)
|
|
23
|
+
Init
|
|
29
24
|
* example:
|
|
30
25
|
```javascript
|
|
31
|
-
let
|
|
32
|
-
loadComplete: function(data)
|
|
33
|
-
{
|
|
34
|
-
await gu.grid_set_captain(_grid, data);
|
|
35
|
-
}
|
|
36
|
-
```
|
|
26
|
+
let jqu = new Jqgrid_utils();
|
|
37
27
|
|
|
38
|
-
## Functions:
|
|
39
|
-
|
|
40
|
-
### add grid_load_complete to don't show the delete icon
|
|
41
|
-
```javascript
|
|
42
|
-
loadComplete: async function(data)
|
|
43
|
-
{
|
|
44
|
-
jqu.s_hide_del_icon();
|
|
45
|
-
grid_load_complete;
|
|
46
|
-
},
|
|
47
28
|
```
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
loadComplete: async function(data)
|
|
51
|
-
{
|
|
52
|
-
await jqu.hide_del_icon();
|
|
53
|
-
grid_load_complete;
|
|
54
|
-
},
|
|
55
|
-
```
|
|
30
|
+
|
|
56
31
|
|
|
57
32
|
<a name="module_Jqgrid_utils"></a>
|
|
58
33
|
|
|
@@ -62,8 +37,10 @@ A module for Jqgrid_utils
|
|
|
62
37
|
|
|
63
38
|
* [Jqgrid_utils](#module_Jqgrid_utils)
|
|
64
39
|
* [module.exports#set_link()](#exp_module_Jqgrid_utils--module.exports+set_link) ⏏
|
|
65
|
-
* [module.exports#
|
|
40
|
+
* [module.exports#grid_set_caption(_grid, data)](#exp_module_Jqgrid_utils--module.exports+grid_set_caption) ⏏
|
|
41
|
+
* [module.exports#s_resize_saved_cell_width()](#exp_module_Jqgrid_utils--module.exports+s_resize_saved_cell_width) ⏏
|
|
66
42
|
* [module.exports#resize_saved_cell_width(col_model, page, grid)](#exp_module_Jqgrid_utils--module.exports+resize_saved_cell_width) ⏏
|
|
43
|
+
* [module.exports#resize_cell(the, column, not)](#exp_module_Jqgrid_utils--module.exports+resize_cell) ⏏
|
|
67
44
|
* [module.exports#upsert_row()](#exp_module_Jqgrid_utils--module.exports+upsert_row) ⏏
|
|
68
45
|
* [module.exports#insert_row()](#exp_module_Jqgrid_utils--module.exports+insert_row) ⏏
|
|
69
46
|
* [module.exports#update_row()](#exp_module_Jqgrid_utils--module.exports+update_row) ⏏
|
|
@@ -82,9 +59,26 @@ A module for Jqgrid_utils
|
|
|
82
59
|
|
|
83
60
|
### module.exports#set\_link() ⏏
|
|
84
61
|
**Kind**: Exported function
|
|
85
|
-
<a name="exp_module_Jqgrid_utils--module.exports+
|
|
62
|
+
<a name="exp_module_Jqgrid_utils--module.exports+grid_set_caption"></a>
|
|
86
63
|
|
|
87
|
-
### module.exports#grid\_set\
|
|
64
|
+
### module.exports#grid\_set\_caption(_grid, data) ⏏
|
|
65
|
+
**Kind**: Exported function
|
|
66
|
+
|
|
67
|
+
| Param | Type | Description |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| _grid | <code>object</code> | gridobject; |
|
|
70
|
+
| data | <code>object</code> | grid data (optional); |
|
|
71
|
+
|
|
72
|
+
**Example**
|
|
73
|
+
```js
|
|
74
|
+
var jqu = new Jqgrid_utils();
|
|
75
|
+
loadComplete: function(){
|
|
76
|
+
jqu.grid_set_caption(this);
|
|
77
|
+
},
|
|
78
|
+
```
|
|
79
|
+
<a name="exp_module_Jqgrid_utils--module.exports+s_resize_saved_cell_width"></a>
|
|
80
|
+
|
|
81
|
+
### module.exports#s\_resize\_saved\_cell\_width() ⏏
|
|
88
82
|
**Kind**: Exported function
|
|
89
83
|
<a name="exp_module_Jqgrid_utils--module.exports+resize_saved_cell_width"></a>
|
|
90
84
|
|
|
@@ -101,6 +95,22 @@ A module for Jqgrid_utils
|
|
|
101
95
|
```js
|
|
102
96
|
col_model = await jqu.resize_saved_cell_width(col_model);
|
|
103
97
|
```
|
|
98
|
+
<a name="exp_module_Jqgrid_utils--module.exports+resize_cell"></a>
|
|
99
|
+
|
|
100
|
+
### module.exports#resize\_cell(the, column, not) ⏏
|
|
101
|
+
**Kind**: Exported function
|
|
102
|
+
|
|
103
|
+
| Param | Type | Description |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| the | <code>string</code> | width of the resized column |
|
|
106
|
+
| column | <code>string</code> | number what get resized |
|
|
107
|
+
| not | <code>string</code> | in use yet |
|
|
108
|
+
|
|
109
|
+
**Example**
|
|
110
|
+
```js
|
|
111
|
+
var jqu = new Jqgrid_utils({page:'mypage'});
|
|
112
|
+
resizeStop: jqu.resize_cell,
|
|
113
|
+
```
|
|
104
114
|
<a name="exp_module_Jqgrid_utils--module.exports+upsert_row"></a>
|
|
105
115
|
|
|
106
116
|
### module.exports#upsert\_row() ⏏
|
package/_README.md
CHANGED
|
@@ -20,37 +20,12 @@ Example Usage:
|
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* To add the Qty of rows to the Caption text
|
|
26
|
-
* grid_set_captain(_grid, data)
|
|
27
|
-
* _grid: the DOM ID of grid(type: string), example: '#grid'
|
|
28
|
-
* data: the grid data(type: array) (Optional)
|
|
23
|
+
Init
|
|
29
24
|
* example:
|
|
30
25
|
```javascript
|
|
31
|
-
let
|
|
32
|
-
loadComplete: function(data)
|
|
33
|
-
{
|
|
34
|
-
await gu.grid_set_captain(_grid, data);
|
|
35
|
-
}
|
|
36
|
-
```
|
|
26
|
+
let jqu = new Jqgrid_utils();
|
|
37
27
|
|
|
38
|
-
## Functions:
|
|
39
|
-
|
|
40
|
-
### add grid_load_complete to don't show the delete icon
|
|
41
|
-
```javascript
|
|
42
|
-
loadComplete: async function(data)
|
|
43
|
-
{
|
|
44
|
-
jqu.s_hide_del_icon();
|
|
45
|
-
grid_load_complete;
|
|
46
|
-
},
|
|
47
28
|
```
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
loadComplete: async function(data)
|
|
51
|
-
{
|
|
52
|
-
await jqu.hide_del_icon();
|
|
53
|
-
grid_load_complete;
|
|
54
|
-
},
|
|
55
|
-
```
|
|
30
|
+
|
|
56
31
|
|
package/dist/jqgrid_utils.js
CHANGED
|
@@ -46,15 +46,22 @@ module.exports = class Vanilla_website_utils
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
s_grid_set_caption(_grid, data=[])
|
|
50
50
|
{
|
|
51
|
-
this.
|
|
51
|
+
this.grid_set_captionn(_grid, data=[]);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
@alias module:Jqgrid_utils
|
|
56
|
+
@param {object} - gridobject;
|
|
57
|
+
@param {object} - grid data (optional);
|
|
58
|
+
@example
|
|
59
|
+
var jqu = new Jqgrid_utils();
|
|
60
|
+
loadComplete: function(){
|
|
61
|
+
jqu.grid_set_caption(this);
|
|
62
|
+
},
|
|
56
63
|
*/
|
|
57
|
-
async
|
|
64
|
+
async grid_set_caption(_grid, data=[])
|
|
58
65
|
{
|
|
59
66
|
const grid = jQuery(_grid);
|
|
60
67
|
let count = 0;
|
|
@@ -67,17 +74,18 @@ module.exports = class Vanilla_website_utils
|
|
|
67
74
|
count = data.length;
|
|
68
75
|
}
|
|
69
76
|
let caption = grid.jqGrid("getGridParam", "caption");
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
77
|
+
const reg = /\d.*x/;
|
|
78
|
+
const new_caption = caption.replace(reg, "");
|
|
79
|
+
grid.jqGrid('setCaption', new_caption + count + 'x');
|
|
74
80
|
}
|
|
75
81
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
/**
|
|
83
|
+
@alias module:Jqgrid_utils
|
|
84
|
+
*/
|
|
85
|
+
s_resize_saved_cell_width(col_model, page=false, grid=false)
|
|
86
|
+
{
|
|
87
|
+
this.grid_set_caption(col_model, page, grid);
|
|
88
|
+
}
|
|
81
89
|
|
|
82
90
|
|
|
83
91
|
/**
|
|
@@ -86,7 +94,7 @@ module.exports = class Vanilla_website_utils
|
|
|
86
94
|
@param {string} - the name of the page(optional)
|
|
87
95
|
@param {object} - the grid objec(optional)
|
|
88
96
|
@example
|
|
89
|
-
|
|
97
|
+
col_model = await jqu.resize_saved_cell_width(col_model);
|
|
90
98
|
*/
|
|
91
99
|
async resize_saved_cell_width(col_model,page=false, grid=false)
|
|
92
100
|
{
|
|
@@ -112,8 +120,6 @@ module.exports = class Vanilla_website_utils
|
|
|
112
120
|
|
|
113
121
|
/**
|
|
114
122
|
@alias module:Jqgrid_utils
|
|
115
|
-
* resize_cell
|
|
116
|
-
* call after resize a column
|
|
117
123
|
@param {string} the width of the resized column
|
|
118
124
|
@param {string} column number what get resized
|
|
119
125
|
@param {string} not in use yet
|
|
@@ -458,9 +464,9 @@ __cell_format(cell_value, format)
|
|
|
458
464
|
@param {object} - col_model for the table
|
|
459
465
|
@param {string} - Add to the caption of the subgrid
|
|
460
466
|
@example
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
467
|
+
let data_url = api + '/phone_detail?f=data&_id=';
|
|
468
|
+
let col_model_url = api + '/phone_detail?f=col_model';
|
|
469
|
+
let col_model = JSON.parse(await vwu.aget_api(col_model_url))
|
|
464
470
|
*/
|
|
465
471
|
async subgrid(_id, id, data_url, col_model, caption='' )
|
|
466
472
|
{
|
|
@@ -489,7 +495,7 @@ async subgrid(_id, id, data_url, col_model, caption='' )
|
|
|
489
495
|
@param {int} - size of the picture
|
|
490
496
|
@param {bolen} - image path should be a link
|
|
491
497
|
@example
|
|
492
|
-
|
|
498
|
+
col_model = await jqu.add_image(col_model, 'image', 60, false);
|
|
493
499
|
*/
|
|
494
500
|
async add_image(col_model, edit_field, size, link=false)
|
|
495
501
|
{
|
package/jqgrid_utils.js
CHANGED
|
@@ -45,15 +45,22 @@ module.exports = class Vanilla_website_utils
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
s_grid_set_caption(_grid, data=[])
|
|
49
49
|
{
|
|
50
|
-
this.
|
|
50
|
+
this.grid_set_captionn(_grid, data=[]);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
@alias module:Jqgrid_utils
|
|
55
|
+
@param {object} - gridobject;
|
|
56
|
+
@param {object} - grid data (optional);
|
|
57
|
+
@example
|
|
58
|
+
var jqu = new Jqgrid_utils();
|
|
59
|
+
loadComplete: function(){
|
|
60
|
+
jqu.grid_set_caption(this);
|
|
61
|
+
},
|
|
55
62
|
*/
|
|
56
|
-
async
|
|
63
|
+
async grid_set_caption(_grid, data=[])
|
|
57
64
|
{
|
|
58
65
|
const grid = jQuery(_grid);
|
|
59
66
|
let count = 0;
|
|
@@ -66,17 +73,18 @@ module.exports = class Vanilla_website_utils
|
|
|
66
73
|
count = data.length;
|
|
67
74
|
}
|
|
68
75
|
let caption = grid.jqGrid("getGridParam", "caption");
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
76
|
+
const reg = /\d.*x/;
|
|
77
|
+
const new_caption = caption.replace(reg, "");
|
|
78
|
+
grid.jqGrid('setCaption', new_caption + count + 'x');
|
|
73
79
|
}
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
/**
|
|
82
|
+
@alias module:Jqgrid_utils
|
|
83
|
+
*/
|
|
84
|
+
s_resize_saved_cell_width(col_model, page=false, grid=false)
|
|
85
|
+
{
|
|
86
|
+
this.grid_set_caption(col_model, page, grid);
|
|
87
|
+
}
|
|
80
88
|
|
|
81
89
|
|
|
82
90
|
/**
|
|
@@ -85,7 +93,7 @@ module.exports = class Vanilla_website_utils
|
|
|
85
93
|
@param {string} - the name of the page(optional)
|
|
86
94
|
@param {object} - the grid objec(optional)
|
|
87
95
|
@example
|
|
88
|
-
|
|
96
|
+
col_model = await jqu.resize_saved_cell_width(col_model);
|
|
89
97
|
*/
|
|
90
98
|
async resize_saved_cell_width(col_model,page=false, grid=false)
|
|
91
99
|
{
|
|
@@ -111,8 +119,6 @@ module.exports = class Vanilla_website_utils
|
|
|
111
119
|
|
|
112
120
|
/**
|
|
113
121
|
@alias module:Jqgrid_utils
|
|
114
|
-
* resize_cell
|
|
115
|
-
* call after resize a column
|
|
116
122
|
@param {string} the width of the resized column
|
|
117
123
|
@param {string} column number what get resized
|
|
118
124
|
@param {string} not in use yet
|
|
@@ -457,9 +463,9 @@ __cell_format(cell_value, format)
|
|
|
457
463
|
@param {object} - col_model for the table
|
|
458
464
|
@param {string} - Add to the caption of the subgrid
|
|
459
465
|
@example
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
466
|
+
let data_url = api + '/phone_detail?f=data&_id=';
|
|
467
|
+
let col_model_url = api + '/phone_detail?f=col_model';
|
|
468
|
+
let col_model = JSON.parse(await vwu.aget_api(col_model_url))
|
|
463
469
|
*/
|
|
464
470
|
async subgrid(_id, id, data_url, col_model, caption='' )
|
|
465
471
|
{
|
|
@@ -488,7 +494,7 @@ async subgrid(_id, id, data_url, col_model, caption='' )
|
|
|
488
494
|
@param {int} - size of the picture
|
|
489
495
|
@param {bolen} - image path should be a link
|
|
490
496
|
@example
|
|
491
|
-
|
|
497
|
+
col_model = await jqu.add_image(col_model, 'image', 60, false);
|
|
492
498
|
*/
|
|
493
499
|
async add_image(col_model, edit_field, size, link=false)
|
|
494
500
|
{
|
package/package.json
CHANGED