2013-07-26 43 views
2

我試圖讓我的查詢超過200元。所以,我修改查詢應根據this documentation返回結果的限制,但是這是行不通的。任何想法?拉力2.0 SDK - 查詢過濾僅返回200個結果

我想以下幾點:

var tasksWithActualsQuery = Ext.create('Rally.data.WsapiDataStore', 
{ 
    model: 'Task', 
    limit: Infinity, 
    fetch: ['CreationDate', 'Actuals'], 
    filters: 
    [  
     { 
      property: 'CreationDate', 
      operator: '<', 
      value: 'LastMonth' 
     } 
    ] 
}); 

tasksWithActualsQuery.load({ 
    callback: function(records, operation) 
    { 
     if(operation.wasSuccessful()) 
     { 
      var tasksWithActualsCount = 0; 

      Ext.Array.each(records, function(record) { 
       if (record.get('Actuals') != null) 
       { 
        tasksWithActualsCount++; 
       } 
      }); 

      var tasksCount = records.length; 
      alert(tasksCount); 
     } 
    } 
});     
+0

是否使用到RC1之前版本AppSDK2的? – nickm

+0

是的。 '<腳本類型= 「文本/ JavaScript的」 SRC = 「/應用/ 2.0rc1/sdk.js」>' – adolfosrs

回答

2

你的代碼是正確─的重要組成部分,是極限:無限。

不幸的似乎是一個無瑕疵Rally.data.WsapiDataStore沒有從負載調用傳遞正確的參數到您的回調函數。它只是通過商店而不是記錄,操作成功。

,直到故障修復這應該讓你現在:

tasksWithActualsQuery.load({ 
    callback: function(store) { 
     var tasksWithActualsCount = 0; 

     store.each(function(record) { 
      if (record.get('Actuals') != null) { 
       tasksWithActualsCount++; 
      } 
     }); 

     var tasksCount = store.getTotalCount(); 
     alert(tasksCount); 
    } 
});