open-resource-row
PRO
The functionality is available in PRO Edition only
Description
Fires when a parent resource row is expanded or collapsed in ResourceLoadSee ResourceLoad component API
Usage
"open-resource-row": ({
id: string | number,
mode: boolean,
}) => boolean | void;
info
For handling the actions you can use the Event Bus methods
Parameters
The callback of the open-resource-row action takes an object with the following parameters:
id- (required) the ID of the parent resource row to expand or collapsemode- (required)trueto expand the row,falseto collapse it
Example
Use the api.exec method to expand or collapse a resource row programmatically:
<script setup>
import { getData } from "./common/data";
import { Gantt, ResourceLoad } from "@svar/vue-gantt";
import { ref } from "vue";
const { tasks, links, resources, assignments } = getData();
const api = ref();
function init(ganttApi) {
api.value = ganttApi;
ganttApi.exec("open-resource-row", { id: "team1", mode: true });
}
</script>
<template>
<div style="height: 60%">
<Gantt
:tasks="tasks"
:links="links"
:resources="resources"
:assignments="assignments"
:init="init"
/>
</div>
<div style="height: 40%">
<ResourceLoad :api="api" />
</div>
</template>
Related articles: