BS ListGroup html

I am using the BS Listgroup to present multiple database rows to a user. I would like the string I pass to the .addItem function to have multiple line breaks.
This is the code:

function GetOpenActivityFromSQLCallBack(transaction, results){
  if(results.rows.length > 0){
    var choice;
    for(i=0; i<=results.rows.length-1; i++){
      choice = 'Contract: ' + results.rows.item(i)['contract_name'] + ' Task: ' + results.rows.item(i)['task_number'] + ' Date: ' + results.rows.item(i)['activity_date'] + ' Started: ' + results.rows.item(i)['activity_start'] 
      listOpenTasks.addItem(choice);
      }
  }
  }

I would like this to display as:

Contract: value
Task: value
Date: value
Started: value

Will the list group support this, and how would I translate this to Html that the List group will display properly?

Ryan

The string passed to addItem can be HTML, so give this a try:

choice = 'Contract: ' + results.rows.item(i)['contract_name'] + 
  ' <br>Task: ' + results.rows.item(i)['task_number'] + 
  ' <br>Date: ' + results.rows.item(i)['activity_date'] + 
  ' <br>Started: ' + results.rows.item(i)['activity_start'] 

<br> inserts a line break in the string.

Awesome! Thank you! So, is the html markup accessed via the ‘inner html’?

The second part of my question would be: how would I keep a hidden key value for the row that I could read when a user clicks the row in the BS List group?

You can see a sample of this in the Wiki:
https://wiki.appstudio.dev/Listgroup_(Bootstrap)

You’ll need to keep your hidden key values in a separate array.