5 Replies Latest reply: Aug 19, 2011 5:54 AM by patscher RSS

    How to Get Selections From TableBox with JavaScript

      Dear all,

       

      I'm developing an ASPX-Website with including QlikView-Objects.

      Following this thread: http://community.qlik.com/message/87561#87561

      I've got selections from a listbox pretty well...

      But how about selections from a tablebox?

      Is there any way to achieve this?

       

      I know there is a "current selections/status"-box available for QV-dashboards.

      Is it possible to access this data? Or to capture the data which is sent this box?

       

      I would really appreciate your help.

      Thanks in advance...

       

      Kind regards,

      Patrick

        • How to Get Selections From TableBox with JavaScript

          What version of QlikView are you using?

          • How to Get Selections From TableBox with JavaScript

            You can retrieve the data from a Current Selections object. It is similar to how you would loop through data for a the table object; however, the Current Selections object has it's limitations... you will notice that if you select "n " number of values for a listbox field, the Current Selections only displays a certain number of values instead of what is selected. 

             

            There are a couple of other approaches you can try...  1) Use the list box object and use the QvaPublic API's GetSelected() method.  That will return you an array of objects for all current selected values for that list box.  The problem with this is that you won't know what fields are selected.  2) you can create a table object that has the same field as the listbox and loop through it's data object as it only displays the vales that are currently selected.  Again same problem, you won't know what field was acutally selected.

             

            What I've done in the past is used the Current Selections and List Box Object together.  Loop through the current selections object table to let you know which fields have been selected, then for each row get the list box associated with that field and then call the GetSelected() function.

             

            I hope this makes since. I can send you a snippet of code for looking at the Current Selections.