ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
393 stars 48 forks source link

Data Grid regression. MtxGridColumn with buttons do not detect changes #203

Closed ChrTall closed 1 year ago

ChrTall commented 1 year ago

I have an MtxGridColumn with buttons that has the following action:

{
      header: 'Actions',
      field: 'publishing',
      width: '180px',
      type: "button",
      buttons: [
          {
          type: 'icon',
          text: 'publish',
          icon: 'public',
          tooltip: 'Publish item.',
          disabled: (item: Item): boolean => item.published,
          click: (item: Item): void => {
            this.itemStore.publishItem(item).subscribe({
              next: (res: StoreResultStatus) => {
                if(res.successful) this.rerenderGrid();
              }
            });
          }
        }
      ]
}

The items from the store are an Observable array and are passed to the grid with the async pipe. Modifying a string property in the item rerenders the grid correctly, but the buttons column used to disable the publish button, after an item was published. I think with Version 15.xx this behaviour changed and the button is only disabled, when the page is reloaded.

nzbin commented 1 year ago

Maybe this is a bug, can you give me an online example?

nzbin commented 1 year ago

Please try the new version 15.4.0

ChrTall commented 1 year ago

@nzbin Sorry I was still working on a Stackblitz example, but did not have the time to finish it. Thank you, the bug is fixed and the old behaviour is restored.