This commit is contained in:
2020-03-04 00:02:54 +00:00
parent b7115335e7
commit a932da04c6
3 changed files with 29 additions and 3 deletions

View File

@@ -45,6 +45,9 @@ CURRENT TODOs
@@@@@@@@@@@ ROADMAP STAGE 1 and 2:
todo: grid relative date tokens need to be substituted before query sent to server
todo: when making change to listview filter for saved datalistview and then returning to datatable it's *not* using the latest changes
- maybe it thinks because it has an ID and that ID is the same that it doesn't need to refresh?
- or maybe the cached local copy of that datalistview is not set (if there is one for saved dlv?)
todo: Make functional user settings form with all overrides so can test shit out

View File

@@ -514,12 +514,15 @@ export default {
//this puts a pin in it then resets it after the fetch is completed
var preSelected = [...vm.selected];
//untokenize ListView date token criteria (if there are any)
var untokenizedListView = untokenizeListView(vm.listView);
window.$gz.api
.upsert(vm.apiBaseUrl, {
offset: listOptions.Offset,
limit: listOptions.Limit,
dataListKey: vm.dataListKey,
listView: vm.listView
listView: untokenizedListView
})
.then(res => {
if (res.error != undefined) {
@@ -893,4 +896,19 @@ function loadFormSettings(vm) {
}
}
}
////////////////////
//
function untokenizeListView(lv) {
//[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}]
if (lv == null) {
return lv;
}
//See if it has any date tokens
if (lv.indexOf('"token":true') == -1) {
return;
}
console.log(lv);
console.log(JSON.parse(lv));
}
</script>

View File

@@ -635,6 +635,7 @@ export default {
if (item.tempFilterToken && item.tempFilterToken != "*select*") {
//special relative token
filterItem.op = "="; //equality
filterItem.token = true;
filterItem.value = item.tempFilterToken;
filterItemSet = true;
}
@@ -1526,10 +1527,14 @@ function generateListViewFromEdited(vm) {
}
for (var j = 0; j < ev.filter.items.length; j++) {
var evfi = ev.filter.items[j];
f.items.push({
var thisFilterItem = {
op: evfi.op,
value: evfi.value
});
};
if (evfi.token) {
thisFilterItem.token = true;
}
f.items.push(thisFilterItem);
}
o.filter = f;
}