Skip to main content

edit-rule

Description

Fires when opening the filter editor form

Usage

"edit-rule": ({
id: string | number;
}) => void;

Parameters

The callback of the action takes an object with the following parameters:

  • id - (optional) the id of a rule that is edited

Example

<script>
import { getData } from "./common/data";
import { FilterBuilder } from "wx-svelte-filter";

const { value, fields, options } = getData();

const init = (api) => {
api.on("edit-rule", ev => {
console.log("The id of the rule that was changed:" (ev.id));
});
}

</script>

<FilterBuilder {value} {options} {fields} {init} />

Related articles: