title: jQuery deferred/promise with SPService library
body: <p>I'm trying to get my promise item from SPService SPGetListItemsJson. The issue is that when SPGetListItemsJson is invoked and when requestPromise is done and the deferred is resolve, I would expect the data to pass into my anonymously function in populateDropDownControlWithList but its undefined.</p>
  
  <pre><code>   function populateDropDownControlWithList(option, control, addSelectValue)
      {
          if (typeof (addSelectValue) === 'undefined')
          {
              addSelectValue = false;
          }
  
          var selectedIndex = control.val() ? control.val() : -1;    
          if (addSelectValue)
          {
              control.append('&lt;option value=-1&gt;Select an Option&lt;/option&gt;');
          }
  
          var request = SPGetListItemsJson(option);
          request.done(function (data) // Expect the json object here but it is undefined
          {
              $.each(data, function () 
              {
                  controlappend('&lt;option value=' + this.Id + '&gt;' + this.Title + '&lt;/option&gt;');
              });
          });
      }
  
      function SPGetListItemsJson(option)
      {
          var deferred = $.Deferred();
          var requestsPromise = $().SPServices.SPGetListItemsJson({
              listName: option.Name,
              CAMLQuery: option.Query,
              CAMLViewFields: option.View,
              mappingOverrides: option.Mapping,
              debug: option.Debug,
              async: option.async
          });
  
          requestsPromise.done(function ()
          {
              deferred.resolveWith(this.data); // Verified this.data is populated with the correct result
          });
  
          return deferred.promise();
      }
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>