0

How do we get selected row data in angular-slickgrid(2.26). I am able to do that in regular slickgrid this way:

grid.onClick.subscribe(function (e, args) {
    var item = args.grid.getData()[args.row];
    selectedFromGrid = item.ConfigurationId;
});

How do I do the same thing in angular-slickgrid?

I used to do the following but after updating angular-slickgrid to the latest I started to get GridExtraUtils not found error.

   gridReady(grid) {
grid.onClick.subscribe((e, args) => {
  const column = GridExtraUtils.getColumnDefinitionAndData(args);
  this.router.navigate(['/printclaim/' + column.dataContext.ClaimID]);
});

}

Nakres
  • 1,212
  • 11
  • 27

1 Answers1

0

Just read the Wiki - SlickGrid & DataView Objects

If you want the current row selection, you can get it from SlickGrid with grid.getSelectedRows() or via the Grid State from Angular-Slickgrid, there's also a Wiki - Grid State & Preset

You should really look at all the Wikis...

ghiscoding
  • 12,308
  • 6
  • 69
  • 112
  • Thanks. I edited my question. I used to use GridExtraUtils but I am getting GridExtraUtils not found error after updating the package. – Nakres Feb 17 '21 at 21:15
  • where do u see `GridExtraUtils`? That was maybe something I've used in version `1.x` but it's `GridService` now... `GridExtraUtils` doesn't anymore that's for sure – ghiscoding Feb 17 '21 at 22:11
  • I am updating the old code. The page was written 3 years ago with angular sg version 0.7.4. I am checking your wikis now, have not seen getSelectedRows() yet I guess it is somewhere there. – Nakres Feb 19 '21 at 13:57
  • well if you were on the version `0.x`, you really have to read the [Migration Wiki](https://github.com/ghiscoding/Angular-Slickgrid/wiki/Migration-from-1.x-to-2.x), even the migration was written from 1.x to 2.x and you're on an even much older and unsupported version, I've done a lot of structural changes since original version – ghiscoding Feb 19 '21 at 14:43