akveo / akveo/ng2-smart-table

rowData not available in onComponentInitFunction

Open
#941 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
867
PR merge metrics
No merged PRs in 30d

Description

In the onComponentInitFunction the rowData property is not available. There is a way to make it available or is a new feature?

A solution can be:

replace in file https://github.com/akveo/ng2-smart-table/blob/master/src/ng2-smart-table/components/cell/cell-view-mode/custom-view.component.ts#L50 replace

onComponentInitFunction && onComponentInitFunction(this.customComponent.instance);

with

onComponentInitFunction && onComponentInitFunction(this.customComponent.instance, this.getPatch());

and then use as

...
onComponentInitFunction: (instance, rowData) => {
console.log(rowData);
}
...

OR call `this.patchInstance()` **before** calling `this.callOnComponentInit()`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.