jqgrid_utils 1.3.7 → 1.3.8
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 +25 -3
- package/dist/jqgrid_utils.js +31 -1
- package/jqgrid_utils.js +31 -1
- 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) ⏏
|
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