This commit is contained in:
@@ -54,7 +54,8 @@ TODO: LOCALIZATION
|
||||
- Keep the ones that rely on filtering dates between values because that's how the client will be sending the relative filters
|
||||
|
||||
- DataTable, make bools display as checkboxes instead of text (could just use icons instead of actual checkbox)
|
||||
|
||||
- DataTable Need enum translator in it's own class or maybe part of locale or uses locale I guess
|
||||
|
||||
- Determine best way to handle filters at client then code it
|
||||
- Modify datalist server code to alternatively accept a json filter string instead of a filter ID (post?)
|
||||
- Actually, this is jsut for relative dates so, instead how about optional start and stop date parameters to go with filterid that contains relative filter?
|
||||
|
||||
@@ -484,7 +484,8 @@ function buildRecords(listData, columndefinitions, filters) {
|
||||
);
|
||||
break;
|
||||
case 10: //enum
|
||||
display = filters.enum(display, columndefinitions[iColumn].et);
|
||||
//TODO: Need enum translator
|
||||
display = columndefinitions[iColumn].et + "." + display;
|
||||
break;
|
||||
default:
|
||||
//do nothing, allow it to stay as is
|
||||
|
||||
@@ -139,37 +139,13 @@ document.addEventListener("fetchEnd", function() {
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// FILTERS
|
||||
//
|
||||
//example filter kept for just in case
|
||||
// Vue.filter("capitalize", function vueFilterCapitalize(value) {
|
||||
// if (!value) return "";
|
||||
// value = value.toString();
|
||||
// return value.charAt(0).toUpperCase() + value.slice(1);
|
||||
// });
|
||||
|
||||
Vue.filter("capitalize", function vueFilterCapitalize(value) {
|
||||
if (!value) return "";
|
||||
value = value.toString();
|
||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||
});
|
||||
|
||||
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Browser_compatibility
|
||||
//https://www.currency-iso.org/en/home.html
|
||||
Vue.filter("currency", function vueFilterCurrency(value) {
|
||||
if (!value) return "";
|
||||
return value.toLocaleString(window.$gz.locale.getBrowserLanguages(), {
|
||||
style: "currency",
|
||||
currency: "EUR"
|
||||
});
|
||||
});
|
||||
|
||||
Vue.filter("decimal", function vueFilterDecimal(value) {
|
||||
if (!value) return "";
|
||||
return "dec.fltr." + value;
|
||||
});
|
||||
|
||||
Vue.filter("boolastext", function vueFilterBoolAsText(value) {
|
||||
if (!value) return "";
|
||||
return value ? "Yup" : "Nope";
|
||||
});
|
||||
|
||||
Vue.filter("enum", function vueFilterDecimal(value, enumtype) {
|
||||
if (!value) return enumtype + ".";
|
||||
return enumtype + "." + value; //todo: actual values here
|
||||
});
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
//GZ COMPONENTS
|
||||
|
||||
Reference in New Issue
Block a user