title: Displaying values as selected state within option values
body: <p>I am fighting somewhat to get my output in AllGroups - Group 1 to appear as the selected item in my option value within the returned group_html.</p>
  
  <p>Can anyone help?</p>
  
  <pre><code>    var existing_groups = $.map(calEvent.users, function(group){
          return group.group_id;
      });
  
      var group_html = $.map(calEvent.AllGroups, function(group) {
          return '&lt;option value="G|' + group.id + '"' + ((existing_groups.indexOf(group.id) &gt; -1) ? ' selected ' : '') + '&gt;' +
                  'Group: ' + group.name +
              '&lt;/option&gt;';
      }).join('');
  
      return group_html;
  
      // calEvent.users (output)
      // 175833: {id: "22322", group_id: "545",  name: "Group 1"}
      // 175834: {id: "22323", group_id: "534", name: "Group 2"}
  
      //calEvent.AllGroups (output)
      //0: {id: "22322",  name: "Group 1" }
  </code></pre>