jqgrid_utils 1.2.18 → 1.2.19
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 +12 -12
- package/dist/jqgrid_utils.js +1 -2
- package/jqgrid_utils.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ A module for Jqgrid_utils
|
|
|
46
46
|
* [module.exports#insert_row(row, url)](#exp_module_Jqgrid_utils--module.exports+insert_row) ⇒ <code>object</code> ⏏
|
|
47
47
|
* [module.exports#update_row(row, url, req)](#exp_module_Jqgrid_utils--module.exports+update_row) ⇒ <code>object</code> ⏏
|
|
48
48
|
* [module.exports#delete_row(_id, url)](#exp_module_Jqgrid_utils--module.exports+delete_row) ⇒ <code>object</code> ⏏
|
|
49
|
-
* [module.exports#adelete_api(url)](#exp_module_Jqgrid_utils--module.exports+adelete_api) ⇒ <code>object</code> ⏏
|
|
49
|
+
* [module.exports#adelete_api(url, json)](#exp_module_Jqgrid_utils--module.exports+adelete_api) ⇒ <code>object</code> ⏏
|
|
50
50
|
* [module.exports#post_json(url, data)](#exp_module_Jqgrid_utils--module.exports+post_json) ⇒ <code>object</code> ⏏
|
|
51
51
|
* [module.exports#put_json(url, data)](#exp_module_Jqgrid_utils--module.exports+put_json) ⇒ <code>object</code> ⏏
|
|
52
52
|
* [module.exports#s_hide_del_icon()](#exp_module_Jqgrid_utils--module.exports+s_hide_del_icon) ⏏
|
|
@@ -164,7 +164,7 @@ resizeStop: jqu.resize_cell,
|
|
|
164
164
|
Upsert(insert or update) from the grid to an API
|
|
165
165
|
|
|
166
166
|
**Kind**: Exported function
|
|
167
|
-
**Returns**: <code>object</code> - {update: 'ok'} or {
|
|
167
|
+
**Returns**: <code>object</code> - {update: 'ok'} or {update: 'failed'}
|
|
168
168
|
|
|
169
169
|
| Param | Type | Description |
|
|
170
170
|
| --- | --- | --- |
|
|
@@ -177,7 +177,7 @@ Upsert(insert or update) from the grid to an API
|
|
|
177
177
|
var jqu = new Jqgrid_utils();
|
|
178
178
|
afterSetRow: async function(row)
|
|
179
179
|
{
|
|
180
|
-
let r = await jqu.upsert_row(row,
|
|
180
|
+
let r = await jqu.upsert_row(row, 'http://api.com',{'key':'value'});
|
|
181
181
|
console.log(r);
|
|
182
182
|
},
|
|
183
183
|
```
|
|
@@ -192,15 +192,14 @@ Insert from the grid to an API used by the upsert_row function
|
|
|
192
192
|
| Param | Type | Description |
|
|
193
193
|
| --- | --- | --- |
|
|
194
194
|
| row | <code>object</code> | row object |
|
|
195
|
-
| url | <code>string</code> |
|
|
196
|
-
| | <code>string</code> | data oject |
|
|
195
|
+
| url | <code>string</code> | URL of the API |
|
|
197
196
|
|
|
198
197
|
**Example**
|
|
199
198
|
```js
|
|
200
199
|
var jqu = new Jqgrid_utils();
|
|
201
200
|
afterSetRow: async function(row)
|
|
202
201
|
{
|
|
203
|
-
let r = await jqu.
|
|
202
|
+
let r = await jqu.insert_row(row, 'http://api.com');
|
|
204
203
|
console.log(r);
|
|
205
204
|
},
|
|
206
205
|
```
|
|
@@ -223,7 +222,7 @@ Update from the grid to an API used by the upsert_row function
|
|
|
223
222
|
var jqu = new Jqgrid_utils();
|
|
224
223
|
afterSetRow: async function(row)
|
|
225
224
|
{
|
|
226
|
-
let r = await jqu.
|
|
225
|
+
let r = await jqu.update_row(row, 'http://api.com',{'key':value});
|
|
227
226
|
console.log(r);
|
|
228
227
|
},
|
|
229
228
|
```
|
|
@@ -245,21 +244,22 @@ Delete from the grid to an API
|
|
|
245
244
|
var jqu = new Jqgrid_utils();
|
|
246
245
|
afterDelRow: async function(row)
|
|
247
246
|
{
|
|
248
|
-
const r = await jqu.delete_row(
|
|
247
|
+
const r = await jqu.delete_row('id', 'http://api.com');
|
|
249
248
|
console.log(r + ' : ' + row + ' - from API');
|
|
250
249
|
},
|
|
251
250
|
```
|
|
252
251
|
<a name="exp_module_Jqgrid_utils--module.exports+adelete_api"></a>
|
|
253
252
|
|
|
254
|
-
### module.exports#adelete\_api(url) ⇒ <code>object</code> ⏏
|
|
253
|
+
### module.exports#adelete\_api(url, json) ⇒ <code>object</code> ⏏
|
|
255
254
|
Async Delete request used by function delete_row
|
|
256
255
|
|
|
257
256
|
**Kind**: Exported function
|
|
258
257
|
**Returns**: <code>object</code> - @returns {object} Object from the the API like {delete: 'ok'} or {delete: 'failed'}
|
|
259
258
|
|
|
260
|
-
| Param | Type | Description |
|
|
261
|
-
| --- | --- | --- |
|
|
262
|
-
| url | <code>string</code> | url of the API |
|
|
259
|
+
| Param | Type | Default | Description |
|
|
260
|
+
| --- | --- | --- | --- |
|
|
261
|
+
| url | <code>string</code> | | url of the API |
|
|
262
|
+
| json | <code>boalan</code> | <code>false</code> | header should be json type? default form type |
|
|
263
263
|
|
|
264
264
|
**Example**
|
|
265
265
|
```js
|
package/dist/jqgrid_utils.js
CHANGED
|
@@ -203,8 +203,7 @@ async upsert_row(row, url, req = {})
|
|
|
203
203
|
* Insert from the grid to an API used by the upsert_row function
|
|
204
204
|
@alias module:Jqgrid_utils
|
|
205
205
|
@param {object} - row object
|
|
206
|
-
@param {string} -
|
|
207
|
-
@param {string} - data oject
|
|
206
|
+
@param {string} - URL of the API
|
|
208
207
|
@returns {object} Object from the the API like {update: 'ok'} or {update: 'failed'}
|
|
209
208
|
@example
|
|
210
209
|
var jqu = new Jqgrid_utils();
|
package/jqgrid_utils.js
CHANGED
|
@@ -174,12 +174,12 @@ col_model = await jqu.resize_saved_cell_width(col_model);
|
|
|
174
174
|
@param {object} - row object
|
|
175
175
|
@param {string} - url of the API
|
|
176
176
|
@param {string} - data oject
|
|
177
|
-
@returns {object} {update: 'ok'} or {
|
|
177
|
+
@returns {object} {update: 'ok'} or {update: 'failed'}
|
|
178
178
|
@example
|
|
179
179
|
var jqu = new Jqgrid_utils();
|
|
180
180
|
afterSetRow: async function(row)
|
|
181
181
|
{
|
|
182
|
-
let r = await jqu.upsert_row(row,
|
|
182
|
+
let r = await jqu.upsert_row(row, 'http://api.com',{'key':'value'});
|
|
183
183
|
console.log(r);
|
|
184
184
|
},
|
|
185
185
|
*/
|
|
@@ -202,14 +202,13 @@ async upsert_row(row, url, req = {})
|
|
|
202
202
|
* Insert from the grid to an API used by the upsert_row function
|
|
203
203
|
@alias module:Jqgrid_utils
|
|
204
204
|
@param {object} - row object
|
|
205
|
-
@param {string} -
|
|
206
|
-
@param {string} - data oject
|
|
205
|
+
@param {string} - URL of the API
|
|
207
206
|
@returns {object} Object from the the API like {update: 'ok'} or {update: 'failed'}
|
|
208
207
|
@example
|
|
209
208
|
var jqu = new Jqgrid_utils();
|
|
210
209
|
afterSetRow: async function(row)
|
|
211
210
|
{
|
|
212
|
-
let r = await jqu.
|
|
211
|
+
let r = await jqu.insert_row(row, 'http://api.com');
|
|
213
212
|
console.log(r);
|
|
214
213
|
},
|
|
215
214
|
*/
|
|
@@ -245,7 +244,7 @@ async insert_row(row, url)
|
|
|
245
244
|
var jqu = new Jqgrid_utils();
|
|
246
245
|
afterSetRow: async function(row)
|
|
247
246
|
{
|
|
248
|
-
let r = await jqu.
|
|
247
|
+
let r = await jqu.update_row(row, 'http://api.com',{'key':value});
|
|
249
248
|
console.log(r);
|
|
250
249
|
},
|
|
251
250
|
*/
|
|
@@ -280,7 +279,7 @@ async update_row(row, url, req = {})
|
|
|
280
279
|
var jqu = new Jqgrid_utils();
|
|
281
280
|
afterDelRow: async function(row)
|
|
282
281
|
{
|
|
283
|
-
const r = await jqu.delete_row(
|
|
282
|
+
const r = await jqu.delete_row('id', 'http://api.com');
|
|
284
283
|
console.log(r + ' : ' + row + ' - from API');
|
|
285
284
|
},
|
|
286
285
|
*/
|
|
@@ -306,6 +305,7 @@ async delete_row(_id, url)
|
|
|
306
305
|
* Async Delete request used by function delete_row
|
|
307
306
|
@alias module:Jqgrid_utils
|
|
308
307
|
@param {string} - url of the API
|
|
308
|
+
@param {boalan} - header should be json type? default form type
|
|
309
309
|
@returns {object} @returns {object} Object from the the API like {delete: 'ok'} or {delete: 'failed'}
|
|
310
310
|
@example
|
|
311
311
|
var jqu = new Jqgrid_utils();
|
package/package.json
CHANGED