Skip to content

Commit

Permalink
fix: handle Row clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Dec 7, 2024
1 parent 54ae7eb commit 06d985a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions desk/src/components/ListViewBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
class="flex-1"
:columns="columns"
:rows="rows"
row-key="email"
row-key="name"
:options="{
selectable: true,
showTooltip: true,
resizeColumn: false,
onRowClick: () => {},
onRowClick: (row: Object) => emit('onRowClick', row['name']),
emptyState: props.options?.emptyState || defaultEmptyState,
}"
>
Expand Down Expand Up @@ -115,6 +115,7 @@ interface P {
interface E {
(event: "emptyStateAction"): void;
(event: "onRowClick", row: any): void;
}
const props = defineProps<P>();
Expand Down
17 changes: 17 additions & 0 deletions desk/src/pages/desk/team/TeamList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:options="{
doctype: 'HD Team',
}"
@on-row-click="handleRowClick"
/>
<Dialog
v-model="showNewDialog"
Expand Down Expand Up @@ -91,4 +92,20 @@ usePageMeta(() => {
title: "Teams",
};
});
function handleRowClick(rowID: string) {
router.push({
name: AGENT_PORTAL_TEAM_SINGLE,
params: {
teamId: rowID,
},
});
}
// onClick = {
// name: AGENT_PORTAL_TEAM_SINGLE,
// params: {
// teamId: d.name,
// },
// };
</script>

0 comments on commit 06d985a

Please sign in to comment.