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>
import { getData } from "./common/data";
import { Gantt, ResourceLoad } from "@svar-ui/svelte-gantt";

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

let api = $state();

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

<Gantt bind:this={api} {tasks} {scales} {resources} {assignments} {init} />
<ResourceLoad {api} />

Related articles: