Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
ErikWetterberg
Honored Contributor

Re: How to make Qlik Sense extensions built with AngularJS re-render on resize or when the data changes?

Hi,

Yes that's a way to do it: the Validated event is actually not an angular event, but one that Qlik Sense defines. You probably also could use the paint method.

Erik Wetterberg

rhannuschka
New Contributor

Re: How to make Qlik Sense extensions built with AngularJS re-render on resize or when the data chan

A bit late maybe, but we have not the same problem. I want to know when grid cell size has been changed so we could recalculate some stuff ( scrollbars / virtual scroll). At this point we use Angular 2+ to create extensions so the Angular1 scope is not very usefull.

In short ( this is Typescript nothing special for JS just remove Types ) to get notified something has been changed, just use the MutationObserver to get notified some styles changes  ( or other dom properties ).

// get parent cell which describes width and height of the cell
const cell: HTMLElement = $element.closest('.cell').get(0);
const obs = new MutationObserver((mutations) => {
    // at this point we get notified if grid cell style has been changed
    // this could be width, height, left or top 
    // this only happens if we  modify the grid cell into editor
    console.log(mutations);
});

/** tell the mutation observer to watch the cell for style changes */
obs.observe(cell, {
    attributes: true,
    attributeFilter: ["style"]
});

/** @todo disconnect on destroy to avoid memory leaks */