Broadcast change event with Kendo MVVM

时间:2018-03-23 00:33:22

标签: kendo-ui

I need to broadcast the kendo combobox change event to other client side layers. Does kendo have any way like scope.emit or scope.broadcast which is present in angular that broadcast any event. I have multiple layers on my client side and 1 layer has all the kendo observables, these observables are bind to html, event are also bind to VM, is it possible that I can broadcast this change event. Any inputs to this will be highly appreciated

2 个答案:

答案 0 :(得分:0)

搜索文档,我在Telerik上得到了这个例子:

使用(selectionChange)=“selectionChange($ event)”

 @Component({
        selector: 'my-app',
        template: `
        <kendo-combobox [data]="data"
          [filterable]="true"
          (valueChange)="valueChange($event)"
          (selectionChange)="selectionChange($event)"
          (filterChange)="filterChange($event)"
          (open)="open()"
          (close)="close()"
          (focus)="focus()"
          (blur)="blur()"
        >
        </kendo-combobox>
        <event-log title="Event log" [events]="events">
        </event-log>
      `
    })

在导出类中:

public selectionChange(value: any): void {
    this.log('selectionChange', value);
}

有关事件列表,请检查:

<强> https://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/

答案 1 :(得分:0)

您应该调用将触发更改事件的set method