use pk instead of agentid to set active row
This commit is contained in:
parent
4ec57d740e
commit
85a57d60ef
|
@ -41,9 +41,9 @@
|
|||
<q-tr
|
||||
@contextmenu="agentRowSelected(props.row.id, props.row.agent_id)"
|
||||
:props="props"
|
||||
:class="{highlight: selectedRow === props.row.agent_id}"
|
||||
:class="{highlight: selectedRow === props.row.id}"
|
||||
@click="agentRowSelected(props.row.id, props.row.agent_id)"
|
||||
@dblclick="rowDoubleClicked(props.row.agent_id)"
|
||||
@dblclick="rowDoubleClicked(props.row.id)"
|
||||
>
|
||||
<!-- context menu -->
|
||||
<q-menu context-menu>
|
||||
|
@ -277,8 +277,8 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
rowDoubleClicked(agentid) {
|
||||
this.$store.commit("setActiveRow", agentid);
|
||||
rowDoubleClicked(pk) {
|
||||
this.$store.commit("setActiveRow", pk);
|
||||
this.$q.loading.show();
|
||||
// give time for store to change active row
|
||||
setTimeout(()=>{
|
||||
|
@ -406,8 +406,8 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
agentRowSelected(pk, agentid) {
|
||||
this.$store.commit("setActiveRow", agentid);
|
||||
agentRowSelected(pk) {
|
||||
this.$store.commit("setActiveRow", pk);
|
||||
this.$store.dispatch("loadSummary", pk);
|
||||
this.$store.dispatch("loadChecks", pk);
|
||||
this.$store.dispatch("loadWinUpdates", pk);
|
||||
|
|
|
@ -17,7 +17,7 @@ export const store = new Vuex.Store({
|
|||
clients: {},
|
||||
tree: [],
|
||||
treeReady: false,
|
||||
selectedRow: "",
|
||||
selectedRow: null,
|
||||
agentSummary: {},
|
||||
winUpdates: {},
|
||||
agentChecks: {},
|
||||
|
@ -52,8 +52,8 @@ export const store = new Vuex.Store({
|
|||
AGENT_TABLE_LOADING(state, visible) {
|
||||
state.agentTableLoading = visible;
|
||||
},
|
||||
setActiveRow(state, agentid) {
|
||||
state.selectedRow = agentid;
|
||||
setActiveRow(state, pk) {
|
||||
state.selectedRow = pk;
|
||||
},
|
||||
retrieveToken(state, { token, username }) {
|
||||
state.token = token;
|
||||
|
|
Loading…
Reference in New Issue