Skip to main content

open-resource-row

PRO

The functionality is available in PRO Edition only

Description

Fires when a parent resource row is expanded or collapsed in ResourceLoad

See 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 collapse
  • mode - (required) true to expand the row, false to 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-ui/vue-gantt";
import { ref } from "vue";

const { tasks, scales, resources, assignments } = getData();

const api = ref();

function init(api) {
api.exec("open-resource-row", { id: "team1", mode: true });
}
</script>

<template>
<Gantt ref="api" :tasks="tasks" :scales="scales" :resources="resources" :assignments="assignments" :init="init" />
<ResourceLoad :api="api" />
</template>

Related articles: