jqgrid_utils 1.3.7 → 1.4.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 +27 -7
- package/_README.md +2 -4
- package/dist/jqgrid_utils.js +31 -1
- package/jqgrid_utils.js +31 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,11 +8,9 @@ Demo:
|
|
|
8
8
|
|
|
9
9
|
Add a the library to your website
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
`html
|
|
11
|
+
```html
|
|
13
12
|
<script src="../node_modules/jqgrid_utils/dist/jqgrid_utils.js"></script>
|
|
14
|
-
|
|
15
|
-
``
|
|
13
|
+
```
|
|
16
14
|
|
|
17
15
|
|
|
18
16
|
Example Usage:
|
|
@@ -38,7 +36,8 @@ A module for Jqgrid_utils
|
|
|
38
36
|
* [Jqgrid_utils](#module_Jqgrid_utils)
|
|
39
37
|
* [module.exports#get_filled_cell_table_data(_grid, fields)](#exp_module_Jqgrid_utils--module.exports+get_filled_cell_table_data) ⇒ <code>array</code> ⏏
|
|
40
38
|
* [module.exports#get_filled_cell_data(_grid, fields)](#exp_module_Jqgrid_utils--module.exports+get_filled_cell_data) ⇒ <code>object</code> ⏏
|
|
41
|
-
* [module.exports#set_link(col_model, edit_field, url)](#exp_module_Jqgrid_utils--module.exports+set_link) ⇒ <code>
|
|
39
|
+
* [module.exports#set_link(col_model, edit_field, url)](#exp_module_Jqgrid_utils--module.exports+set_link) ⇒ <code>object</code> ⏏
|
|
40
|
+
* [module.exports#hide_column(col_model, field)](#exp_module_Jqgrid_utils--module.exports+hide_column) ⇒ <code>object</code> ⏏
|
|
42
41
|
* [module.exports#s_grid_set_caption(_grid, data)](#exp_module_Jqgrid_utils--module.exports+s_grid_set_caption) ⏏
|
|
43
42
|
* [module.exports#grid_set_caption(_grid, data)](#exp_module_Jqgrid_utils--module.exports+grid_set_caption) ⏏
|
|
44
43
|
* [module.exports#s_resize_saved_cell_width(col_model, page, grid)](#exp_module_Jqgrid_utils--module.exports+s_resize_saved_cell_width) ⏏
|
|
@@ -100,11 +99,11 @@ col_model = await jqu.set_link(col_model,'av0_code','url_code','target="blank"')
|
|
|
100
99
|
```
|
|
101
100
|
<a name="exp_module_Jqgrid_utils--module.exports+set_link"></a>
|
|
102
101
|
|
|
103
|
-
### module.exports#set\_link(col_model, edit_field, url) ⇒ <code>
|
|
102
|
+
### module.exports#set\_link(col_model, edit_field, url) ⇒ <code>object</code> ⏏
|
|
104
103
|
Add an URL from the data to a specific cell/column
|
|
105
104
|
|
|
106
105
|
**Kind**: Exported function
|
|
107
|
-
**Returns**: <code>
|
|
106
|
+
**Returns**: <code>object</code> - https://foo.bar.com/av0_code/bar
|
|
108
107
|
|
|
109
108
|
| Param | Type | Description |
|
|
110
109
|
| --- | --- | --- |
|
|
@@ -118,6 +117,27 @@ var jqu = new Jqgrid_utils();
|
|
|
118
117
|
let _data = await jqu.get_filled_cell_data(this,["P-","bulk","wholesale"]);
|
|
119
118
|
console.log(_data);
|
|
120
119
|
```
|
|
120
|
+
<a name="exp_module_Jqgrid_utils--module.exports+hide_column"></a>
|
|
121
|
+
|
|
122
|
+
### module.exports#hide\_column(col_model, field) ⇒ <code>object</code> ⏏
|
|
123
|
+
Hide a col_model column before load the grid
|
|
124
|
+
|
|
125
|
+
**Kind**: Exported function
|
|
126
|
+
**Returns**: <code>object</code> - col_model
|
|
127
|
+
|
|
128
|
+
| Param | Type | Description |
|
|
129
|
+
| --- | --- | --- |
|
|
130
|
+
| col_model | <code>object</code> | col_model of the grid |
|
|
131
|
+
| field | <code>string</code> | name of the column to hide |
|
|
132
|
+
|
|
133
|
+
**Example**
|
|
134
|
+
```js
|
|
135
|
+
if(filter['_filter'] == 'ch_p_higher_ch_plus_10pc')
|
|
136
|
+
{
|
|
137
|
+
col_model = await jqu.hide_column(col_model,'wholesale');
|
|
138
|
+
col_model = await jqu.hide_column(col_model,'wholesale_formula');
|
|
139
|
+
}
|
|
140
|
+
```
|
|
121
141
|
<a name="exp_module_Jqgrid_utils--module.exports+s_grid_set_caption"></a>
|
|
122
142
|
|
|
123
143
|
### module.exports#s\_grid\_set\_caption(_grid, data) ⏏
|
package/_README.md
CHANGED
package/dist/jqgrid_utils.js
CHANGED
|
@@ -112,7 +112,7 @@ col_model = await jqu.set_link(col_model,'av0_code','url_code','target="blank"')
|
|
|
112
112
|
@param {object} - col_model of the grid
|
|
113
113
|
@param {string} - name of the column what should get convert to the url
|
|
114
114
|
@param {string} - the used url of the data
|
|
115
|
-
@returns {
|
|
115
|
+
@returns {object} https://foo.bar.com/av0_code/bar
|
|
116
116
|
@example
|
|
117
117
|
var jqu = new Jqgrid_utils();
|
|
118
118
|
let _data = await jqu.get_filled_cell_data(this,["P-","bulk","wholesale"]);
|
|
@@ -133,6 +133,36 @@ console.log(_data);
|
|
|
133
133
|
return col_model;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Hide a col_model column before load the grid
|
|
140
|
+
@alias module:Jqgrid_utils
|
|
141
|
+
@param {object} - col_model of the grid
|
|
142
|
+
@param {string} - name of the column to hide
|
|
143
|
+
@returns {object} col_model
|
|
144
|
+
@example
|
|
145
|
+
if(filter['_filter'] == 'ch_p_higher_ch_plus_10pc')
|
|
146
|
+
{
|
|
147
|
+
col_model = await jqu.hide_column(col_model,'wholesale');
|
|
148
|
+
col_model = await jqu.hide_column(col_model,'wholesale_formula');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
*/
|
|
152
|
+
async hide_column(col_model,field)
|
|
153
|
+
{
|
|
154
|
+
for(let i=0;i< col_model.length;i++)
|
|
155
|
+
{
|
|
156
|
+
if(col_model[i]['name'] === field)
|
|
157
|
+
{
|
|
158
|
+
console.log("fffffffF");
|
|
159
|
+
col_model[i]['hidden'] = true;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return col_model;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
136
166
|
/**
|
|
137
167
|
@alias module:Jqgrid_utils
|
|
138
168
|
@param {object} - gridobject;
|
package/jqgrid_utils.js
CHANGED
|
@@ -111,7 +111,7 @@ col_model = await jqu.set_link(col_model,'av0_code','url_code','target="blank"')
|
|
|
111
111
|
@param {object} - col_model of the grid
|
|
112
112
|
@param {string} - name of the column what should get convert to the url
|
|
113
113
|
@param {string} - the used url of the data
|
|
114
|
-
@returns {
|
|
114
|
+
@returns {object} https://foo.bar.com/av0_code/bar
|
|
115
115
|
@example
|
|
116
116
|
var jqu = new Jqgrid_utils();
|
|
117
117
|
let _data = await jqu.get_filled_cell_data(this,["P-","bulk","wholesale"]);
|
|
@@ -132,6 +132,36 @@ console.log(_data);
|
|
|
132
132
|
return col_model;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Hide a col_model column before load the grid
|
|
139
|
+
@alias module:Jqgrid_utils
|
|
140
|
+
@param {object} - col_model of the grid
|
|
141
|
+
@param {string} - name of the column to hide
|
|
142
|
+
@returns {object} col_model
|
|
143
|
+
@example
|
|
144
|
+
if(filter['_filter'] == 'ch_p_higher_ch_plus_10pc')
|
|
145
|
+
{
|
|
146
|
+
col_model = await jqu.hide_column(col_model,'wholesale');
|
|
147
|
+
col_model = await jqu.hide_column(col_model,'wholesale_formula');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
*/
|
|
151
|
+
async hide_column(col_model,field)
|
|
152
|
+
{
|
|
153
|
+
for(let i=0;i< col_model.length;i++)
|
|
154
|
+
{
|
|
155
|
+
if(col_model[i]['name'] === field)
|
|
156
|
+
{
|
|
157
|
+
console.log("fffffffF");
|
|
158
|
+
col_model[i]['hidden'] = true;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return col_model;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
135
165
|
/**
|
|
136
166
|
@alias module:Jqgrid_utils
|
|
137
167
|
@param {object} - gridobject;
|
package/package.json
CHANGED