<?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: Reference hypercube or chart values in JavaScript in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379620#M31311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that happens because Qlik Sense creates a fixed amount of rows whose cell values are just switched out while scrolling. I played around a little bit but could not find an easy solution / workaround for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you're better off creating your own table extension. Maybe check out this link: &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/sense-developer/1.0/Subsystems/Workbench/Content/CodeExamples/ext_simpletable.htm" title="http://help.qlik.com/en-US/sense-developer/1.0/Subsystems/Workbench/Content/CodeExamples/ext_simpletable.htm"&gt;Simple table (extension example) ‒ Qlik Sense Developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Dec 2017 14:42:44 GMT</pubDate>
    <dc:creator>m_s</dc:creator>
    <dc:date>2017-12-12T14:42:44Z</dc:date>
    <item>
      <title>Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379611#M31302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We hope to do something very cool with Qlik Sense Mash-ups. We want to allow users to enter text into an empty text field that's within a table. And then hope to&amp;nbsp; reference some of that other data &lt;STRONG&gt;on that same row in the table where they entered that tex&lt;/STRONG&gt;t in the JavaScript/html input/form to be sent as a POST request to an API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would allow them to post to our API via Qlik! So I think I have two questions:&lt;/P&gt;&lt;P&gt;1) How to make a text input box within a qlik sense table OR if this is not possible I think I'll just have to use hypercube to build an html table that would have an input box. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) How to use the Qlik API to pull contents from that specific row in the Qlik table into a POST json. Again if this is not possible I'll have to go from the ground-up to build a html table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 12:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379611#M31302</guid>
      <dc:creator>liam_hanninen</dc:creator>
      <dc:date>2017-09-08T12:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379612#M31303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought this was an interesting use case so I built a little POC for you:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15051213106292452 jive_text_macro" jivemacro_uid="_15051213106292452" modifiedtitle="true"&gt;
&lt;P&gt;var app = qlik.openApp('456942a2-d3e2-40a5-bad6-985e80294f05', config);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;app.getObject('QV01', 'BSNjEu').then(model =&amp;gt; {&lt;/P&gt;
&lt;P&gt;console.log('loaded:', model);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;var table = qlik.table(model);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// set timeout for now, some invalidated event would probably be a better fit&lt;/P&gt;
&lt;P&gt;setTimeout(() =&amp;gt; {&lt;/P&gt;
&lt;P&gt;console.log('table:', table);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;$('#QV01 [tid] .qv-st-data table tbody tr').each((i, tr) =&amp;gt; {&lt;/P&gt;
&lt;P&gt;var input = $('&amp;lt;input type="text" class="lui-input"/&amp;gt;');&lt;/P&gt;
&lt;P&gt;var data = {};&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;$(tr).find('td').each((i, td) =&amp;gt; {&lt;/P&gt;
&lt;P&gt;td = $(td);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// get cell object from angular scope&lt;/P&gt;
&lt;P&gt;var cell = angular.element(td).scope().cell;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if(cell.type == undefined || cell.dataColIx &amp;lt; 0)&lt;/P&gt;
&lt;P&gt;return;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;var header = table.headers[cell.dataColIx];&lt;/P&gt;
&lt;P&gt;var column = header.field ? header.field.fldname : header.qFallbackTitle;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// create property for this cell&lt;/P&gt;
&lt;P&gt;// using either field name or table header&lt;/P&gt;
&lt;P&gt;// and append value to row data object&lt;/P&gt;
&lt;P&gt;data[column] = cell.text;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// append input field after&lt;/P&gt;
&lt;P&gt;var isLast = table.colCount == td.index() + 1;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if(isLast) {&lt;/P&gt;
&lt;P&gt;td.after(input);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;input.wrap($('&amp;lt;td class="qv-st-data-cell"&amp;gt;&amp;lt;div class="qv-st-value"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;'));&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// save data for later use&lt;/P&gt;
&lt;P&gt;input.data(data);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// and assign change event handler&lt;/P&gt;
&lt;P&gt;input.change(function(){&lt;/P&gt;
&lt;P&gt;var value = $(this).val();&lt;/P&gt;
&lt;P&gt;var data = $(this).data();&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;data.inputValue = value;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;console.log('sending data: ', data);&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;}, 1000);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work for straight tables but the're probably some issues as this is just a small example. I also don't know how this will perform on very big tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="example.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/176089_example.jpg" style="height: 199px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 09:22:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379612#M31303</guid>
      <dc:creator>m_s</dc:creator>
      <dc:date>2017-09-11T09:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379613#M31304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mathias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very cool! Thanks for taking a stab at it. I will try this later today. Two quick questions that are probably obvious to you but:&lt;/P&gt;&lt;P&gt;1) When I try to replicate this can I just switch out the app id and object id for the table? Or do I need to change anything else?&lt;/P&gt;&lt;P&gt;2) It looks like var data is what would be the content from the text box. Is that correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 13:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379613#M31304</guid>
      <dc:creator>liam_hanninen</dc:creator>
      <dc:date>2017-09-11T13:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379614#M31305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can just switch the app and object id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, the data variable contains the row-data for the current input field (should've probably named the variable on line 14 rowData in the first place &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the content of the data variable in the screenshot just below the code snippet. Thats the output of the "console.log" statement on line 53.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 12 to 31 are responsible for looping over the table rows and their columns creating a javascript object for every row in the following form:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"FIELD NAME1 OR COLUMN HEADER1": "VALUE OF COLUMN1",&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"FIELD NAME2 OR COLUMN HEADER2": "VALUE OF COLUMN2",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 34 to 41 are appending a &amp;lt;td&amp;gt; element containing the input field after the last data column and line 44 uses the &lt;A href="https://api.jquery.com/data/"&gt;jQuery .data &lt;/A&gt;method to append custom data to an html element (think of data-blabla attributes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 47-54 assigns an event handler for the changed event (will be triggered after you tab out of the textbox), extracts the object that was set in line 44 and creates a property "inputValue" with the &amp;lt;input&amp;gt;-elements current value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the data variable contains probably everything you want to send to your REST API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 13:50:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379614#M31305</guid>
      <dc:creator>m_s</dc:creator>
      <dc:date>2017-09-11T13:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379615#M31306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mathias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much! I was able to replicate it on a mash-up. I see the text box and I can type in it. I'm noticing some strange behavior that maybe was expected but it's saying: 'Uncaught TypeError: Cannot read property 'dataColIx' of undefined' whenever I highlight the text within the text box - for each character of the text box.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2017_09_11_12_46_17_Qlik_Sense_Mashup.png" class="jive-image image-1" height="274" src="https://community.qlik.com/legacyfs/online/176146_2017_09_11_12_46_17_Qlik_Sense_Mashup.png" style="height: 273.529px; width: 248px;" width="248" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 17:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379615#M31306</guid>
      <dc:creator>liam_hanninen</dc:creator>
      <dc:date>2017-09-11T17:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379616#M31307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Liam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which version of Qlik Sense are you using? The server I built this on is running on June 2017 Patch 2, maybe the property does not exist in older versions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataColIx-property is only used for extracting the header information from the table api (either fieldName or fallbackTitle). Maybe you can use the td.index() method instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 07:21:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379616#M31307</guid>
      <dc:creator>m_s</dc:creator>
      <dc:date>2017-09-12T07:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379617#M31308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! That helps. One last thing &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; I think this is something you'll be able to answer really quickly; I just want to know how to add a title to that new column with the text fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 15:26:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379617#M31308</guid>
      <dc:creator>liam_hanninen</dc:creator>
      <dc:date>2017-09-12T15:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379618#M31309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following (just add it before line 12):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var customHeader = $('&amp;lt;th class="qv-st-header-cell"&amp;gt;&amp;lt;/th&amp;gt;');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customHeader.html('&amp;lt;div class="qv-st-value"&amp;gt;EXTRACOLUMN&amp;lt;/div&amp;gt;')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$('#QV01 [tid] .qv-st-header table tbody tr:first th').eq(-2).after(customHeader);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 16:02:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379618#M31309</guid>
      <dc:creator>m_s</dc:creator>
      <dc:date>2017-09-12T16:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379619#M31310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for building this out &lt;A href="https://community.qlik.com/qlik-users/227348"&gt;m.schindler&lt;/A&gt;‌ I have&amp;nbsp; one more issue that you may be able to resolve pretty quickly. The hards part may be just demonstrating what the problem is haha. When I type in text and then scroll the text in each box stays in there as I scroll. Does that make sense? Please see screen shots.&lt;IMG alt="textBox1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/186301_textBox1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="textbox2.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/186305_textbox2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 20:07:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379619#M31310</guid>
      <dc:creator>liam_hanninen</dc:creator>
      <dc:date>2017-12-08T20:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379620#M31311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that happens because Qlik Sense creates a fixed amount of rows whose cell values are just switched out while scrolling. I played around a little bit but could not find an easy solution / workaround for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you're better off creating your own table extension. Maybe check out this link: &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/sense-developer/1.0/Subsystems/Workbench/Content/CodeExamples/ext_simpletable.htm" title="http://help.qlik.com/en-US/sense-developer/1.0/Subsystems/Workbench/Content/CodeExamples/ext_simpletable.htm"&gt;Simple table (extension example) ‒ Qlik Sense Developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2017 14:42:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379620#M31311</guid>
      <dc:creator>m_s</dc:creator>
      <dc:date>2017-12-12T14:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reference hypercube or chart values in JavaScript</title>
      <link>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379621#M31312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for the follow up! I will check that out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2017 14:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Reference-hypercube-or-chart-values-in-JavaScript/m-p/1379621#M31312</guid>
      <dc:creator>liam_hanninen</dc:creator>
      <dc:date>2017-12-12T14:50:38Z</dc:date>
    </item>
  </channel>
</rss>

