<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Detecting when sheet changes / when extension instance is destoryed in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427592#M20115</link>
    <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16584"&gt;@master_t&lt;/a&gt;&lt;/SPAN&gt; , please use the &lt;A href="https://help.qlik.com/en-US/sense-developer/August2023/Subsystems/APIs/Content/Sense_ClientAPIs/ExtensionAPI/beforeDestroy-method.htm" target="_blank"&gt;beforeDestroy &lt;/A&gt;hook for handling this and for unbinding the listener.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2024 08:56:42 GMT</pubDate>
    <dc:creator>alex_colombo</dc:creator>
    <dc:date>2024-03-06T08:56:42Z</dc:date>
    <item>
      <title>Detecting when sheet changes / when extension instance is destoryed</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427186#M20099</link>
      <description>&lt;P&gt;Hellow fellow devs&lt;/P&gt;
&lt;P&gt;I'm developing a Qlik Sense extension that monitors the selection state of the app and does some processing in the background that I will not bore you with.&lt;/P&gt;
&lt;P&gt;What matters to me is this: I've used this code to monitor the selection state, as suggested in the official documentation:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const app = qlik.currApp();
const selState = app.selectionState();
const listener = () =&amp;gt; {
    /* ...do whatever... */
};
selState.OnData.bind(listener);&lt;/LI-CODE&gt;
&lt;P&gt;this works quite well and I receive a callback every time selections change, which is what I want.&lt;/P&gt;
&lt;P&gt;However, there is a problem with this implementation that I don't know how to solve. Basically, once registered the listener callback keeps getting called when selections change, &lt;STRONG&gt;even if I move away from the sheet that contains my extension object&lt;/STRONG&gt;. This is a problem, because it means my listener code keeps executing even when not needed, creating unwanted side effects.&lt;/P&gt;
&lt;P&gt;I thought to solve this it would be a simple matter of unbinding the listener when the user navigates away from the sheet, but I've read the entire documentation and I don't see anything that can help me there. I didn't find a "sheet changed" event, and there doesn't even seem to be an opposite of the "paint" method ("destroy" maybe or something like that) that I could leverage to detect when my extension is out of scope. What would be the best way to do it?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 14:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427186#M20099</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2024-03-05T14:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting when sheet changes / when extension instance is destoryed</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427592#M20115</link>
      <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16584"&gt;@master_t&lt;/a&gt;&lt;/SPAN&gt; , please use the &lt;A href="https://help.qlik.com/en-US/sense-developer/August2023/Subsystems/APIs/Content/Sense_ClientAPIs/ExtensionAPI/beforeDestroy-method.htm" target="_blank"&gt;beforeDestroy &lt;/A&gt;hook for handling this and for unbinding the listener.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 08:56:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427592#M20115</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-03-06T08:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting when sheet changes / when extension instance is destoryed</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427636#M20119</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/145804"&gt;@alex_colombo&lt;/a&gt;&amp;nbsp;, I somehow missed that hook when reading the docs!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 09:50:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Detecting-when-sheet-changes-when-extension-instance-is/m-p/2427636#M20119</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2024-03-06T09:50:24Z</dc:date>
    </item>
  </channel>
</rss>

