jqgrid_utils 1.3.6 → 1.3.9
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 +26 -4
- package/_README.md +2 -4
- package/dist/jqgrid_utils.js +32 -2
- package/jqgrid_utils.js +32 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,8 @@ A module for Jqgrid_utils
|
|
|
38
38
|
* [Jqgrid_utils](#module_Jqgrid_utils)
|
|
39
39
|
* [module.exports#get_filled_cell_table_data(_grid, fields)](#exp_module_Jqgrid_utils--module.exports+get_filled_cell_table_data) ⇒ <code>array</code> ⏏
|
|
40
40
|
* [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>
|
|
41
|
+
* [module.exports#set_link(col_model, edit_field, url)](#exp_module_Jqgrid_utils--module.exports+set_link) ⇒ <code>object</code> ⏏
|
|
42
|
+
* [module.exports#hide_column(col_model, field)](#exp_module_Jqgrid_utils--module.exports+hide_column) ⇒ <code>object</code> ⏏
|
|
42
43
|
* [module.exports#s_grid_set_caption(_grid, data)](#exp_module_Jqgrid_utils--module.exports+s_grid_set_caption) ⏏
|
|
43
44
|
* [module.exports#grid_set_caption(_grid, data)](#exp_module_Jqgrid_utils--module.exports+grid_set_caption) ⏏
|
|
44
45
|
* [module.exports#s_resize_saved_cell_width(col_model, page, grid)](#exp_module_Jqgrid_utils--module.exports+s_resize_saved_cell_width) ⏏
|
|
@@ -100,11 +101,11 @@ col_model = await jqu.set_link(col_model,'av0_code','url_code','target="blank"')
|
|
|
100
101
|
```
|
|
101
102
|
<a name="exp_module_Jqgrid_utils--module.exports+set_link"></a>
|
|
102
103
|
|
|
103
|
-
### module.exports#set\_link(col_model, edit_field, url) ⇒ <code>
|
|
104
|
+
### module.exports#set\_link(col_model, edit_field, url) ⇒ <code>object</code> ⏏
|
|
104
105
|
Add an URL from the data to a specific cell/column
|
|
105
106
|
|
|
106
107
|
**Kind**: Exported function
|
|
107
|
-
**Returns**: <code>
|
|
108
|
+
**Returns**: <code>object</code> - https://foo.bar.com/av0_code/bar
|
|
108
109
|
|
|
109
110
|
| Param | Type | Description |
|
|
110
111
|
| --- | --- | --- |
|
|
@@ -118,6 +119,27 @@ var jqu = new Jqgrid_utils();
|
|
|
118
119
|
let _data = await jqu.get_filled_cell_data(this,["P-","bulk","wholesale"]);
|
|
119
120
|
console.log(_data);
|
|
120
121
|
```
|
|
122
|
+
<a name="exp_module_Jqgrid_utils--module.exports+hide_column"></a>
|
|
123
|
+
|
|
124
|
+
### module.exports#hide\_column(col_model, field) ⇒ <code>object</code> ⏏
|
|
125
|
+
Hide a col_model column before load the grid
|
|
126
|
+
|
|
127
|
+
**Kind**: Exported function
|
|
128
|
+
**Returns**: <code>object</code> - col_model
|
|
129
|
+
|
|
130
|
+
| Param | Type | Description |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| col_model | <code>object</code> | col_model of the grid |
|
|
133
|
+
| field | <code>string</code> | name of the column to hide |
|
|
134
|
+
|
|
135
|
+
**Example**
|
|
136
|
+
```js
|
|
137
|
+
if(filter['_filter'] == 'ch_p_higher_ch_plus_10pc')
|
|
138
|
+
{
|
|
139
|
+
col_model = await jqu.hide_column(col_model,'wholesale');
|
|
140
|
+
col_model = await jqu.hide_column(col_model,'wholesale_formula');
|
|
141
|
+
}
|
|
142
|
+
```
|
|
121
143
|
<a name="exp_module_Jqgrid_utils--module.exports+s_grid_set_caption"></a>
|
|
122
144
|
|
|
123
145
|
### module.exports#s\_grid\_set\_caption(_grid, data) ⏏
|
|
@@ -479,7 +501,7 @@ let data_url = api + '/order_ln';
|
|
|
479
501
|
data_url = await add_parameters(data_url, param);
|
|
480
502
|
let col_model_url2 = api + '/order_ln?f=col_model';
|
|
481
503
|
let col_model2 = JSON.parse(await vwu.aget_api(col_model_url2));
|
|
482
|
-
await jqu.subgrid(_id, false, data_url, col_model2,'Order Lines for' + row_data['style']);
|
|
504
|
+
await jqu.subgrid(_id, false, data_url, col_model2,'Order Lines for ' + row_data['style']);
|
|
483
505
|
},
|
|
484
506
|
```
|
|
485
507
|
<a name="exp_module_Jqgrid_utils--module.exports+add_image"></a>
|
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;
|
|
@@ -761,7 +791,7 @@ let data_url = api + '/order_ln';
|
|
|
761
791
|
data_url = await add_parameters(data_url, param);
|
|
762
792
|
let col_model_url2 = api + '/order_ln?f=col_model';
|
|
763
793
|
let col_model2 = JSON.parse(await vwu.aget_api(col_model_url2));
|
|
764
|
-
await jqu.subgrid(_id, false, data_url, col_model2,'Order Lines for' + row_data['style']);
|
|
794
|
+
await jqu.subgrid(_id, false, data_url, col_model2,'Order Lines for ' + row_data['style']);
|
|
765
795
|
},
|
|
766
796
|
|
|
767
797
|
*/
|
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;
|
|
@@ -760,7 +790,7 @@ let data_url = api + '/order_ln';
|
|
|
760
790
|
data_url = await add_parameters(data_url, param);
|
|
761
791
|
let col_model_url2 = api + '/order_ln?f=col_model';
|
|
762
792
|
let col_model2 = JSON.parse(await vwu.aget_api(col_model_url2));
|
|
763
|
-
await jqu.subgrid(_id, false, data_url, col_model2,'Order Lines for' + row_data['style']);
|
|
793
|
+
await jqu.subgrid(_id, false, data_url, col_model2,'Order Lines for ' + row_data['style']);
|
|
764
794
|
},
|
|
765
795
|
|
|
766
796
|
*/
|
package/package.json
CHANGED