title: How do I access the datafields in the source object of a jqxlistbox
body: <p>I'm trying to bind a JQXListbox to JSON data and display two fields in the result.</p>
  
  <p>I want to access the datafields in the source object as strings in order to concatenate them so as I can set the resulting string as the displayMember property of jqxListBox.  I've tried calling ToString() on the source.datafields[x] array but that doesn't work either.</p>
  
  <p>I'm not sure if the terminology was correct there.   Thanks for any help you can give.</p>
  
  <p>Here is the code.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;link href="scripts/jqwidgets/styles/jqx.base.css" rel="stylesheet" type="text/css"&gt;
          &lt;link href="scripts/jqwidgets/styles/jqx.classic.css" rel="stylesheet" type="text/css"&gt;
          &lt;script src="scripts/jquery-1.9.1.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="scripts/jqwidgets/jqxcore.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="scripts/jqwidgets/jqxbuttons.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="scripts/jqwidgets/jqxscrollbar.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="scripts/jqwidgets/jqxdata.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="scripts/jqwidgets/jqxlistbox.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="jqxlistbox"&gt;&lt;/div&gt;
          &lt;script type="text/javascript"&gt;
              var string;
  
              $(document).ready(function() {
  
                  // prepare the data
                  var source =
                          {
                              datatype: "json",
                              datafields: [
                                  {name: 'firstname'},
                                  {name: 'lastname'}
                              ],
                              url: 'my url is here'
  
                          };
                          string = source.datafields[0] + source.datafields[1];
                          alert(string);
                  var dataAdapter = new $.jqx.dataAdapter(source);
  
                  $("#jqxlistbox").jqxListBox(
                          {
                              source: dataAdapter,
                              theme: 'classic',
                              width: 200,
                              height: 250,
                              displayMember: 'string',
                              valueMember: 'firstname'
                          });
              });
  
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>