sort-tasks
Description
Fires when sorting tasksUsage
"sort-tasks": ({
key:string,
order:"asc"|"desc"
}) => boolean | void;
Parameters
The callback of the sort-tasks action can take an object with the following parameters:
key
- (required) data field nameorder
- (required) the sorting direction that can be "asc" or "desc"
info
For handling the actions you can use the Event Bus methods
Example
The example below demonstrates how to enable sorting for the text field.
<script>
import { getData } from "./common/data";
import { Gantt } from "wx-svelte-gantt";
const data = getData();
function init(api) {
api.intercept("sort-tasks", (config) => {
return config.key == "text";
});
}
</script>
<Gantt tasks={data.tasks} links={data.links} {init} />
Related articles: