This commit is contained in:
@@ -44,7 +44,9 @@
|
||||
<template v-if="c.t < 9">
|
||||
<template v-if="c.i">
|
||||
<!-- openable object with an ID -->
|
||||
<v-btn depressed small>{{ c.v }}</v-btn>
|
||||
<v-btn depressed small @click="btnClick(c.key, c.i)">{{
|
||||
c.v
|
||||
}}</v-btn>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ c.v }}
|
||||
@@ -88,6 +90,7 @@ export default {
|
||||
loading: true,
|
||||
options: {},
|
||||
headers: [],
|
||||
serverColumns: [],
|
||||
totalRecords: 0,
|
||||
records: [],
|
||||
rowsPerPageItems: [5, 10, 25, 50, 100],
|
||||
@@ -124,18 +127,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
test(item) {
|
||||
console.log(item);
|
||||
/*
|
||||
<tr v-for="item in items" :key="item.name">
|
||||
<td>{{ test(item) }}</td>
|
||||
<td>CONTENT</td>
|
||||
<td>CONTENT</td>
|
||||
<td>CONTENT</td>
|
||||
<td>CONTENT</td>
|
||||
<td>CONTENT</td>
|
||||
</tr> */
|
||||
debugger;
|
||||
btnClick(key, i) {
|
||||
//translate key to actual object type from header data
|
||||
//key format is row-column e.g."500-2"
|
||||
//get the datatype of the column which matches the server columns array index
|
||||
var typeToOpen = this.serverColumns[key.split("-")[1]].ay;
|
||||
|
||||
//i is the actual AyaNova index of that record so we have all we need to open that object
|
||||
alert("STUB: Open object type " + typeToOpen + " with record id of " + i);
|
||||
},
|
||||
lt(ltKey) {
|
||||
return window.$gz.locale.get(ltKey);
|
||||
@@ -199,6 +198,8 @@ export default {
|
||||
window.$gz.api.get(listUrl).then(res => {
|
||||
//NOTE: This is how to call an async function and await it from sync code
|
||||
(async function() {
|
||||
//Save a copy of the server columns data for handling button clicks etc later
|
||||
that.serverColumns = res.columns;
|
||||
//Make sure the locale keys are fetched
|
||||
await fetchLocalizedHeaderNames(res.columns); //Note can use await here because it's wrapped inside an async function call, it will wait then resume next stuff below
|
||||
//build that.headers here
|
||||
|
||||
Reference in New Issue
Block a user