jqgrid_utils 1.3.4 → 1.3.6
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 +28 -6
- package/dist/jqgrid_utils.js +35 -5
- package/jqgrid_utils.js +35 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ A module for Jqgrid_utils
|
|
|
57
57
|
* [module.exports#add_link_details_separator(col_model, url, edit_field, attr, keys)](#exp_module_Jqgrid_utils--module.exports+add_link_details_separator) ⏏
|
|
58
58
|
* [module.exports#add_link_separator(col_model, url, edit_field, fields)](#exp_module_Jqgrid_utils--module.exports+add_link_separator) ⏏
|
|
59
59
|
* [module.exports#__cell_format()](#exp_module_Jqgrid_utils--module.exports+__cell_format) ⏏
|
|
60
|
-
* [module.exports#subgrid(_id, id,
|
|
60
|
+
* [module.exports#subgrid(_id, id, url, col_model, caption)](#exp_module_Jqgrid_utils--module.exports+subgrid) ⏏
|
|
61
61
|
* [module.exports#add_image(col_model, edit_field, size, link)](#exp_module_Jqgrid_utils--module.exports+add_image) ⏏
|
|
62
62
|
* [module.exports#set_filter(grid, data, fx, append_to)](#exp_module_Jqgrid_utils--module.exports+set_filter) ⏏
|
|
63
63
|
* [module.exports#_filter()](#exp_module_Jqgrid_utils--module.exports+_filter) ⏏
|
|
@@ -443,22 +443,44 @@ Private Function
|
|
|
443
443
|
**Kind**: Exported function
|
|
444
444
|
<a name="exp_module_Jqgrid_utils--module.exports+subgrid"></a>
|
|
445
445
|
|
|
446
|
-
### module.exports#subgrid(_id, id,
|
|
446
|
+
### module.exports#subgrid(_id, id, url, col_model, caption) ⏏
|
|
447
447
|
**Kind**: Exported function
|
|
448
448
|
|
|
449
449
|
| Param | Type | Description |
|
|
450
450
|
| --- | --- | --- |
|
|
451
451
|
| _id | <code>string</code> | row_id |
|
|
452
452
|
| id | <code>string</code> | data id |
|
|
453
|
-
|
|
|
453
|
+
| url | <code>string</code> | url to request |
|
|
454
454
|
| col_model | <code>object</code> | col_model for the table |
|
|
455
455
|
| caption | <code>string</code> | Add to the caption of the subgrid |
|
|
456
456
|
|
|
457
457
|
**Example**
|
|
458
458
|
```js
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
let
|
|
459
|
+
subGrid: true,
|
|
460
|
+
,subGridRowExpanded: async function(_id, id) {
|
|
461
|
+
let data_url2 = api + '/process_locations?f=data&process=';
|
|
462
|
+
let col_model_url2 = api + '/process_locations?f=col_model';
|
|
463
|
+
let col_model2 = JSON.parse(await vwu.aget_api(col_model_url2));
|
|
464
|
+
await jqu.subgrid(_id, id, data_url2, col_model2,'Locations for Process');
|
|
465
|
+
|
|
466
|
+
let data_url = api + '/process_styles?f=data&process=';
|
|
467
|
+
let col_model_url = api + '/process_styles?f=col_model';
|
|
468
|
+
let col_model = JSON.parse(await vwu.aget_api(col_model_url));
|
|
469
|
+
await jqu.subgrid(_id, id, data_url, col_model,'Styles for Process');
|
|
470
|
+
},
|
|
471
|
+
|
|
472
|
+
or
|
|
473
|
+
|
|
474
|
+
subGrid: true,
|
|
475
|
+
subGridRowExpanded: async function(_id, id) {
|
|
476
|
+
let row_data = jQuery(this).jqGrid ('getRowData', id);
|
|
477
|
+
let param={f:'data','style':row_data['style'],pricelist:'P-TENENGR1'};
|
|
478
|
+
let data_url = api + '/order_ln';
|
|
479
|
+
data_url = await add_parameters(data_url, param);
|
|
480
|
+
let col_model_url2 = api + '/order_ln?f=col_model';
|
|
481
|
+
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']);
|
|
483
|
+
},
|
|
462
484
|
```
|
|
463
485
|
<a name="exp_module_Jqgrid_utils--module.exports+add_image"></a>
|
|
464
486
|
|
package/dist/jqgrid_utils.js
CHANGED
|
@@ -738,14 +738,44 @@ __cell_format(cell_value, format)
|
|
|
738
738
|
@param {object} - col_model for the table
|
|
739
739
|
@param {string} - Add to the caption of the subgrid
|
|
740
740
|
@example
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
let
|
|
741
|
+
subGrid: true,
|
|
742
|
+
,subGridRowExpanded: async function(_id, id) {
|
|
743
|
+
let data_url2 = api + '/process_locations?f=data&process=';
|
|
744
|
+
let col_model_url2 = api + '/process_locations?f=col_model';
|
|
745
|
+
let col_model2 = JSON.parse(await vwu.aget_api(col_model_url2));
|
|
746
|
+
await jqu.subgrid(_id, id, data_url2, col_model2,'Locations for Process');
|
|
747
|
+
|
|
748
|
+
let data_url = api + '/process_styles?f=data&process=';
|
|
749
|
+
let col_model_url = api + '/process_styles?f=col_model';
|
|
750
|
+
let col_model = JSON.parse(await vwu.aget_api(col_model_url));
|
|
751
|
+
await jqu.subgrid(_id, id, data_url, col_model,'Styles for Process');
|
|
752
|
+
},
|
|
753
|
+
|
|
754
|
+
or
|
|
755
|
+
|
|
756
|
+
subGrid: true,
|
|
757
|
+
subGridRowExpanded: async function(_id, id) {
|
|
758
|
+
let row_data = jQuery(this).jqGrid ('getRowData', id);
|
|
759
|
+
let param={f:'data','style':row_data['style'],pricelist:'P-TENENGR1'};
|
|
760
|
+
let data_url = api + '/order_ln';
|
|
761
|
+
data_url = await add_parameters(data_url, param);
|
|
762
|
+
let col_model_url2 = api + '/order_ln?f=col_model';
|
|
763
|
+
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']);
|
|
765
|
+
},
|
|
766
|
+
|
|
744
767
|
*/
|
|
745
|
-
async subgrid(_id, id,
|
|
768
|
+
async subgrid(_id, id, url, col_model, caption='' )
|
|
746
769
|
{
|
|
747
770
|
caption = caption != '' ? caption + ' ' : '';
|
|
748
|
-
|
|
771
|
+
if(id)
|
|
772
|
+
{
|
|
773
|
+
url += id;
|
|
774
|
+
}
|
|
775
|
+
else
|
|
776
|
+
{
|
|
777
|
+
id = '';
|
|
778
|
+
}
|
|
749
779
|
let $s1 = jQuery("<table style='margin: 5px 0' class='" + _id + "_t'></table>");
|
|
750
780
|
$s1.appendTo("#" + jQuery.jgrid.jqID(_id));
|
|
751
781
|
$s1.jqGrid({
|
package/jqgrid_utils.js
CHANGED
|
@@ -737,14 +737,44 @@ __cell_format(cell_value, format)
|
|
|
737
737
|
@param {object} - col_model for the table
|
|
738
738
|
@param {string} - Add to the caption of the subgrid
|
|
739
739
|
@example
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
let
|
|
740
|
+
subGrid: true,
|
|
741
|
+
,subGridRowExpanded: async function(_id, id) {
|
|
742
|
+
let data_url2 = api + '/process_locations?f=data&process=';
|
|
743
|
+
let col_model_url2 = api + '/process_locations?f=col_model';
|
|
744
|
+
let col_model2 = JSON.parse(await vwu.aget_api(col_model_url2));
|
|
745
|
+
await jqu.subgrid(_id, id, data_url2, col_model2,'Locations for Process');
|
|
746
|
+
|
|
747
|
+
let data_url = api + '/process_styles?f=data&process=';
|
|
748
|
+
let col_model_url = api + '/process_styles?f=col_model';
|
|
749
|
+
let col_model = JSON.parse(await vwu.aget_api(col_model_url));
|
|
750
|
+
await jqu.subgrid(_id, id, data_url, col_model,'Styles for Process');
|
|
751
|
+
},
|
|
752
|
+
|
|
753
|
+
or
|
|
754
|
+
|
|
755
|
+
subGrid: true,
|
|
756
|
+
subGridRowExpanded: async function(_id, id) {
|
|
757
|
+
let row_data = jQuery(this).jqGrid ('getRowData', id);
|
|
758
|
+
let param={f:'data','style':row_data['style'],pricelist:'P-TENENGR1'};
|
|
759
|
+
let data_url = api + '/order_ln';
|
|
760
|
+
data_url = await add_parameters(data_url, param);
|
|
761
|
+
let col_model_url2 = api + '/order_ln?f=col_model';
|
|
762
|
+
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']);
|
|
764
|
+
},
|
|
765
|
+
|
|
743
766
|
*/
|
|
744
|
-
async subgrid(_id, id,
|
|
767
|
+
async subgrid(_id, id, url, col_model, caption='' )
|
|
745
768
|
{
|
|
746
769
|
caption = caption != '' ? caption + ' ' : '';
|
|
747
|
-
|
|
770
|
+
if(id)
|
|
771
|
+
{
|
|
772
|
+
url += id;
|
|
773
|
+
}
|
|
774
|
+
else
|
|
775
|
+
{
|
|
776
|
+
id = '';
|
|
777
|
+
}
|
|
748
778
|
let $s1 = jQuery("<table style='margin: 5px 0' class='" + _id + "_t'></table>");
|
|
749
779
|
$s1.appendTo("#" + jQuery.jgrid.jqID(_id));
|
|
750
780
|
$s1.jqGrid({
|
package/package.json
CHANGED