how to save the selection in a list

LabKey Support Forum (Inactive)
how to save the selection in a list Jon (LabKey DevOps)  2015-05-06 12:16
Status: Closed
 
Hi Feifei,

If you use a web debugging tool like Firebug or Google Chrome's JConsole, you can inspect the elements of the list (specifically one of the checkboxes in the first column). All of the checkboxes have a name of ".select", so you can setup a button to identify those that are checked on like this for your XML metadata:

<tables xmlns="http://labkey.org/data/xml">
  <table tableName="ListTest" tableDbType="NOT_IN_DB">
    <columns></columns>
        <buttonBarOptions position="top" includeStandardButtons="true" >
        <item text="OnCLickButton">
          <onClick><![CDATA[
                        for (i=0; i < document.getElementsByName(".select").length; i++){
                            if (document.getElementsByName(".select")[i].checked){
                                alert("Box number " + i + " in the array is checked. Its key value is " + document.getElementsByName(".select")[i].value);
                            }
                        }
                    ]]></onClick>
        </item>
    </buttonBarOptions>
  </table>
</tables>

The XML above creates a button that will identify which boxes are checked and bring up an alert respectively showing which box was checked and the corresponding value of that checkbox that is tied to the specific row.

Regarding your follow-up question, I'm not sure I understand what you're asking here. What user query column are you referring to? Can you provide a screenshot so I can get a better idea of what you're asking to change?

Regards,

Jon