OptionsStore
Stores nested settings and notifies an (optional) observer of changes.
import { OptionsStore } from '@progress/kendo-drawing';
const options = new OptionsStore({
foo: {
bar: true
}
});
observer OptionsObserver
An optional observer for the options
store. Upon field modification, the optionsChange(e)
method on the observer will be called and will provide information for the change.
Constructors
OptionsStore (options?: any)
Parameters
options? any
The initial values of all options.
Methods
get
Gets the value of the specified option.
import { OptionsStore } from '@progress/kendo-drawing';
const options = new OptionsStore({
foo: {
bar: true
}
});
// The bar variable will be set to true by any of these statements:
const bar = options.get("foo.bar");
const bar = options.foo.get("bar");
const bar = options.foo.bar;
Parameters
field string
The field name to retrieve. Has to be a fully qualified name for nested options. For example, "foo.bar"
.
Returns
any - The current option value.
set
Sets the value of the specified option.
import { OptionsStore } from '@progress/kendo-drawing';
const options = new OptionsStore({
foo: {
bar: true
}
});
// The foo.bar setting will be set to false by any of these statements:
options.set("foo.bar", false);
options.foo.set("bar", false);
// The following statement will succeed,
// but will not trigger optionsChange on the observer, if any.
options.foo.bar = false;
Parameters
field string
The name of the option to set. Has to be a fully qualified name for nested options. For example, "foo.bar"
.
value any
The new option value. If the new value is the same as the old value, the operation will not notify the observer, if any.