2

Using Angular 7 and Gridster2.

I have a dashboard which contains multiple widgets. Each widget is separate angular component within gridster item. I have to update a widget data when i click in another widget. My Problem is the model is getting updated successfully but the data is not shown automatically, the changed data is shown after clicking anywhere in gridSter items.

This was working fine when i didn't used GridSter.

Any kind of help is highly appreciated.

1 Answers1

1

You need implement itemChangeCallback event

this.options = {
    itemChangeCallback: this.itemChange.bind(this)
}

call update widget in itemChange

 itemChange() {
       // call function to update widget here
       this.widgetservice.updateDashboard().subscribe(data=>{
       });
 }
Hien Nguyen
  • 24,551
  • 7
  • 52
  • 62
  • I don’t think this is the/an answer: That callback seems to be for when the item configuration has changed. Also, it’s not clear what’s happening with `updateDashboard()`. The problem seems more likely to do with Angular change detection. – andrewf Oct 29 '20 at 17:18