jqgrid_utils 1.27.2 → 1.28.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 +44 -7
- package/dist/.hidden +0 -0
- package/dist/jqgrid_utils.js +1755 -0
- package/jqgrid_utils.js +32 -4
- package/make.sh +0 -2
- package/make_doc.sh +2 -0
- package/package.json +1 -1
package/jqgrid_utils.js
CHANGED
|
@@ -24,7 +24,6 @@ module.exports = class Vanilla_website_utils
|
|
|
24
24
|
/**
|
|
25
25
|
* Takes the updated columns data and send it to your API post server
|
|
26
26
|
* loadComplete: async function() for the old record needs to be called, see example !
|
|
27
|
-
* the jgrid ID must be of type string
|
|
28
27
|
@alias module:Jqgrid_utils
|
|
29
28
|
@param {object} - Grid Object (required)
|
|
30
29
|
@param {string} - API URL like https://foo.com (required)
|
|
@@ -120,7 +119,7 @@ var jqu = new Jqgrid_utils({page:page});
|
|
|
120
119
|
}
|
|
121
120
|
else if(api != '' && Object.keys(row).length > 0 && row.inputData.oper == 'add')
|
|
122
121
|
{
|
|
123
|
-
|
|
122
|
+
console.log("...add");
|
|
124
123
|
for(let i in row.inputData)
|
|
125
124
|
{
|
|
126
125
|
if(row.inputData[i] && i != 'id' && i != 'oper')
|
|
@@ -1184,6 +1183,33 @@ col_model = await jqu.add_link_details_csv(col_model, host + '/html/report.html'
|
|
|
1184
1183
|
}
|
|
1185
1184
|
|
|
1186
1185
|
|
|
1186
|
+
/**
|
|
1187
|
+
* Compare 2 columns and give them a style class when they have different content
|
|
1188
|
+
* http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods
|
|
1189
|
+
@alias module:Jqgrid_utils
|
|
1190
|
+
@param {object} - grid object
|
|
1191
|
+
@param {string} - first column
|
|
1192
|
+
@param {string} - second column
|
|
1193
|
+
@param {string} - css class name
|
|
1194
|
+
@example
|
|
1195
|
+
loadComplete: async function()
|
|
1196
|
+
{
|
|
1197
|
+
await jqu.compare(this,'value','value_report','greenlight');
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
*/
|
|
1201
|
+
async compare(obj, column1, column2, style)
|
|
1202
|
+
{
|
|
1203
|
+
const rows = jQuery(obj).jqGrid('getGridParam','data');
|
|
1204
|
+
for(let i in rows) {
|
|
1205
|
+
if( rows[i][column1] != rows[i][column2] )
|
|
1206
|
+
{
|
|
1207
|
+
jQuery(obj).jqGrid('setCell',rows[i]['id'], column1, "" ,'greenlight');
|
|
1208
|
+
jQuery(obj).jqGrid('setCell',rows[i]['id'], column2, "" ,'greenlight');
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1187
1213
|
/**
|
|
1188
1214
|
* Set styles to individual cells, what are defined in a dedicated column
|
|
1189
1215
|
@alias module:Jqgrid_utils
|
|
@@ -1214,7 +1240,7 @@ var jqu = new Jqgrid_utils();
|
|
|
1214
1240
|
}
|
|
1215
1241
|
}
|
|
1216
1242
|
}
|
|
1217
|
-
|
|
1243
|
+
|
|
1218
1244
|
}
|
|
1219
1245
|
|
|
1220
1246
|
|
|
@@ -1410,7 +1436,9 @@ var jqu = new Jqgrid_utils();
|
|
|
1410
1436
|
'fields':{'style':'style'}
|
|
1411
1437
|
}
|
|
1412
1438
|
]);
|
|
1413
|
-
|
|
1439
|
+
//other example
|
|
1440
|
+
col_model = await jqu.add_link_separator(col_model, 'https://wiki.salamander-jewelry.net/index.php/grid_loss' , 'e',[{'field':'e'}],'target="_blank"');
|
|
1441
|
+
|
|
1414
1442
|
*/
|
|
1415
1443
|
async add_link_separator(col_model, url, edit_field, fields, attr='')
|
|
1416
1444
|
{
|
package/make.sh
CHANGED
package/make_doc.sh
CHANGED
package/package.json
CHANGED