Skip to content

Resizable widgets #34

Open
Open
@anvial

Description

@anvial

Hello again,

I would like to implement resizable widgets. How can I include onResize event in WidgetComponent in manner of цшвпуе "onClose" event

Just adding a new event emitter is not enought:

  @Output() onClose = new EventEmitter<any>();
  @Output() onResize = new EventEmitter<any>();

It causing a error that:
image
during adding widget to dashboard:

this.ref[wId] = this.dashboard.addItem(component);
          this.ref[wId].widgetId = wId;
          this.ref[wId].setSize([wData.sizeX, wData.sizeY]);
          this.ref[wId].ngOnInit();
          this.ref[wId].onClose.subscribe(id => {
            this.dashboard.removeItemById(id);
            for (let w of this.dashboardWidgetDataList) {
              if (w.name === wData.name) {
                let index = this.dashboardWidgetDataList.indexOf(w, 0);
                if (index > -1) {
                  this.dashboardWidgetDataList.splice(index, 1);
                }
              }
            }
          });
// HERE IS A ERROR --->
          this.ref[wId].onResize.subscribe(data => {
            this.ref[data.id].setSize([data.newSize.x, data.newSize.y]);
          });

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions