Enterprise-ng: Datagrid (rendered ) and (afterRender) callbacks are not called

Created on 1 Nov 2018  路  8Comments  路  Source: infor-design/enterprise-ng

Describe the bug
rendered and AfterRender output callbacks are not called when Datagrid is initialized

To Reproduce

  1. add afterRender and rendered outputs callback to datagrid
  2. See that they are never called

Expected behavior
afterRender and rendered callbacks would be called once datagrid is rendered

Additional context
Seen in version 4.11.0

Downloads.zip

[3] type

All 8 comments

see attached Downloads.zip containing html and ts file with reproduction

@pwpatton @tmcconechy - in soho-datagrid the events are hooked up after the data is loaded (esp. if gridData is set).

Moving this block of code after the event hookup code fixes the issue with afterRendered but I am never seeing rendered.

.on('rendered', (e: any, args: SohoDataGridRenderedEvent) => { console.error('rendered'); this.onRendered(args); })

Any ideas when rendered should be called?

It looks like it's called at the end of the init, when again we've not added events. So the event hookup code should go before the widget init call?

@bthharper yes I think so, in most places we seem to hookup events before component init. We should definitely pick one or the other and before the init means we should be able to get the rendered event. Not sure why it's not firing.

Have moved the event hookup code before the init and data method, and it works okay now.

So all good then? I noticed the event is wrongly named afterrender should be afterrendered. To match rendered. But minor..

Would that not need a change in enterprise too?

Yeah that would.. Its covered here for refactoring on a major release. https://github.com/infor-design/enterprise/issues/643 since its breaking (but we could support both so it doesnt). I say leave as is for now.

Was this page helpful?
0 / 5 - 0 ratings