UNPKG

@progress/telerik-jquery-report-viewer

Version:

Progress® Telerik® Report Viewer for jQuery

42 lines (37 loc) 968 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var baseComponent = require('../base-component.js'); class Button extends baseComponent.BaseComponent { // #region fields icon; click; component; // #endregion // #region constructors constructor(element, options) { super(element, options); this.options.icon = element.dataset.icon; this.options.fillMode = element.dataset.fillMode; this.component = new kendo.ui.Button(element, this.options); this._initCommand(); } // #endregion // #region methods _initCommand() { if (!this.options.command) { return; } const command = this.options.command; this.component.setOptions({ click: (event) => { event.preventDefault(); command.exec(); } }); $(command).on("enabledChanged", (event, newState) => { this.component.enable(newState); }); } // #endregion } exports.Button = Button;