jqgrid_utils 1.27.3 → 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/dist/jqgrid_utils.js +28 -1
- package/jqgrid_utils.js +28 -1
- package/package.json +1 -1
package/dist/jqgrid_utils.js
CHANGED
|
@@ -1184,6 +1184,33 @@ col_model = await jqu.add_link_details_csv(col_model, host + '/html/report.html'
|
|
|
1184
1184
|
}
|
|
1185
1185
|
|
|
1186
1186
|
|
|
1187
|
+
/**
|
|
1188
|
+
* Compare 2 columns and give them a style class when they have different content
|
|
1189
|
+
* http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods
|
|
1190
|
+
@alias module:Jqgrid_utils
|
|
1191
|
+
@param {object} - grid object
|
|
1192
|
+
@param {string} - first column
|
|
1193
|
+
@param {string} - second column
|
|
1194
|
+
@param {string} - css class name
|
|
1195
|
+
@example
|
|
1196
|
+
loadComplete: async function()
|
|
1197
|
+
{
|
|
1198
|
+
await jqu.compare(this,'value','value_report','greenlight');
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
*/
|
|
1202
|
+
async compare(obj, column1, column2, style)
|
|
1203
|
+
{
|
|
1204
|
+
const rows = jQuery(obj).jqGrid('getGridParam','data');
|
|
1205
|
+
for(let i in rows) {
|
|
1206
|
+
if( rows[i][column1] != rows[i][column2] )
|
|
1207
|
+
{
|
|
1208
|
+
jQuery(obj).jqGrid('setCell',rows[i]['id'], column1, "" ,'greenlight');
|
|
1209
|
+
jQuery(obj).jqGrid('setCell',rows[i]['id'], column2, "" ,'greenlight');
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1187
1214
|
/**
|
|
1188
1215
|
* Set styles to individual cells, what are defined in a dedicated column
|
|
1189
1216
|
@alias module:Jqgrid_utils
|
|
@@ -1214,7 +1241,7 @@ var jqu = new Jqgrid_utils();
|
|
|
1214
1241
|
}
|
|
1215
1242
|
}
|
|
1216
1243
|
}
|
|
1217
|
-
|
|
1244
|
+
|
|
1218
1245
|
}
|
|
1219
1246
|
|
|
1220
1247
|
|
package/jqgrid_utils.js
CHANGED
|
@@ -1183,6 +1183,33 @@ col_model = await jqu.add_link_details_csv(col_model, host + '/html/report.html'
|
|
|
1183
1183
|
}
|
|
1184
1184
|
|
|
1185
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
|
+
|
|
1186
1213
|
/**
|
|
1187
1214
|
* Set styles to individual cells, what are defined in a dedicated column
|
|
1188
1215
|
@alias module:Jqgrid_utils
|
|
@@ -1213,7 +1240,7 @@ var jqu = new Jqgrid_utils();
|
|
|
1213
1240
|
}
|
|
1214
1241
|
}
|
|
1215
1242
|
}
|
|
1216
|
-
|
|
1243
|
+
|
|
1217
1244
|
}
|
|
1218
1245
|
|
|
1219
1246
|
|
package/package.json
CHANGED