devexpress-reporting
Version:
DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.
35 lines (34 loc) • 1.6 kB
JavaScript
/**
* DevExpress HTML/JS Reporting (chart\widgets\_chartDependencyEditor.js)
* Version: 25.1.3
* Build date: Jun 26, 2025
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* License: https://www.devexpress.com/Support/EULAs/universal.xml
*/
import { extend } from '@devexpress/analytics-core/analytics-internal-native';
import { createViewModelGenerator } from '@devexpress/analytics-core/analytics-serializer-native';
import { Editor } from '@devexpress/analytics-core/analytics-widgets';
import * as ko from 'knockout';
export class ChartDependencyEditor extends Editor {
constructor(info, level, parentDisabled, textToSearch) {
super(info, level, parentDisabled, textToSearch);
}
getViewModel() {
return createViewModelGenerator(super.createViewModel())
.generateProperty('getDependencyOptions', (templateOptions, propertyName, depPropertyName) => this.getDependencyOptions(templateOptions, propertyName, depPropertyName))
.getViewModel();
}
getDependencyOptions(templateOptions, propertyName, depPropertyName) {
if (!this.bindableOptions) {
const debObj = {};
this.depProperty = ko.computed(() => {
const model = this._get('_model');
return model && model[depPropertyName]();
});
this._disposables.push(this.depProperty);
debObj[propertyName] = this.depProperty;
this.bindableOptions = extend({}, this.getOptions(templateOptions), debObj);
}
return this.bindableOptions;
}
}