allow css selection for + like in P+

This commit is contained in:
Wolfgang 2024-05-29 08:26:35 +02:00
parent 1edb72ac38
commit a6e4aa701f

View file

@ -258,7 +258,7 @@ div>label {
// list like cw, narrow will be split to two entries // list like cw, narrow will be split to two entries
column.formatter = function(cell) { column.formatter = function(cell) {
let f = String(cell.getField()).toLowerCase().replace(/[\W]+/g, " ").replaceAll(" ", "_"); let f = String(cell.getField()).toLowerCase().replace(/[\W]+/g, " ").replaceAll(" ", "_");
let v = String(cell.getValue()).toLowerCase().replace(/[^\w,]+/g, " ").replaceAll(" ", "_"); let v = String(cell.getValue()).toLowerCase().replaceAll("+", "_plus_").replace(/[^\w,]+/g, " ").replaceAll(" ", "_");
v.split(",").forEach((s) => { v.split(",").forEach((s) => {
cell.getElement().classList.add("cell-" + f + "-" + s.replace(/^_+|_+$/g, "")); cell.getElement().classList.add("cell-" + f + "-" + s.replace(/^_+|_+$/g, ""));
}); });
@ -275,7 +275,7 @@ div>label {
rowFormatter: function(row){ rowFormatter: function(row){
for (const [key, value] of Object.entries(row.getData())) { for (const [key, value] of Object.entries(row.getData())) {
let k = String(key).toLowerCase().replace(/[\W]+/g, " ").replaceAll(" ", "_"); let k = String(key).toLowerCase().replace(/[\W]+/g, " ").replaceAll(" ", "_");
let v = String(value).toLowerCase().replace(/[^\w,]+/g, " ").replaceAll(" ", "_"); let v = String(value).toLowerCase().replaceAll("+", "_plus_").replace(/[^\w,]+/g, " ").replaceAll(" ", "_");
v.split(",").forEach((s) => { v.split(",").forEach((s) => {
row.getElement().classList.add("row-" + k + "-" + s.replace(/^_+|_+$/g, "")); row.getElement().classList.add("row-" + k + "-" + s.replace(/^_+|_+$/g, ""));
}); });