This commit is contained in:
2020-12-30 19:51:09 +00:00
parent 8b6e2d5359
commit 27866a4038
2 changed files with 20 additions and 6 deletions

View File

@@ -85,7 +85,7 @@
</template>
<template v-else-if="c.t == 4">
<!-- TEXT (also maybe openable)-->
<template v-if="c.i && c.i != 0">
<template v-if="c.i && c.i != 0 && !c.nopen">
<!-- openable object with an ID -->
<div
class="subtitle-1"
@@ -100,7 +100,7 @@
</template>
<template v-else-if="c.t == 5">
<!-- INTEGER -->
<template v-if="c.i && c.i != 0">
<template v-if="c.i && c.i != 0 && !c.nopen">
<!-- openable object with an ID -->
<div
class="subtitle-1"
@@ -260,7 +260,7 @@
</template>
<template v-else-if="c.t == 4">
<!-- TEXT (also maybe openable)-->
<template v-if="c.i && c.i != 0">
<template v-if="c.i && c.i != 0 && !c.nopen">
<!-- openable object with an ID -->
<div
class="subtitle-1"
@@ -275,7 +275,7 @@
</template>
<template v-else-if="c.t == 5">
<!-- INTEGER -->
<template v-if="c.i && c.i != 0">
<template v-if="c.i && c.i != 0 && !c.nopen">
<!-- openable object with an ID -->
<div
class="subtitle-1"
@@ -419,6 +419,10 @@ export default {
reload: {
type: Boolean,
default: false
},
canOpenDefaultObject: {
type: Boolean,
default: true
}
},
watch: {
@@ -652,7 +656,11 @@ export default {
vm.headers = buildHeaders(res.columns);
//Post process data here and then set vm.records
vm.records = buildRecords(res.data, res.columns);
vm.records = buildRecords(
res.data,
res.columns,
vm.canOpenDefaultObject
);
vm.totalRecords = res.totalRecordCount;
//Put back selected items
@@ -703,7 +711,7 @@ function buildHeaders(columnData) {
}
//Called by getDataFromApi on retrieval of list with columnData
function buildRecords(listData, columndefinitions) {
function buildRecords(listData, columndefinitions, canOpenDefaultObject) {
//iterate data, build each object keyed with index name and display set to correct translated filter and then return
let ret = [];
@@ -875,6 +883,7 @@ function buildRecords(listData, columndefinitions) {
t: dataType,
key: iRow + "-" + iColumn
};
//is the source dtalist field openable? If so it will have an i property set for it's ID and we already know the types to open from the column headers data
//so between the two we can make a clickable button in the grid vm triggers a function with the column index and the id and vm in turn will bubble up the event to open vm
//object
@@ -882,6 +891,10 @@ function buildRecords(listData, columndefinitions) {
columnObject["i"] = column.i;
}
if (!canOpenDefaultObject && column.rid) {
columnObject["nopen"] = true;
}
//Is there an overriding openable type already defined?
//(this is used by dynamic columns with different object type and id's that are openable like attachments and event logs and Review list etc)
if (column.ot) {

View File

@@ -20,6 +20,7 @@
:showSelect="rights.read"
:reload="reload"
:metaView="metaView"
:canOpenDefaultObject="false"
v-on:selection-change="handleSelected"
data-cy="service-banksTable"
>