2016-01-13 77 views
0

以我控制器I定義像爲控制器存儲

stores: [ 
    'devices.DevicesStore', 
    'devicegroups.DeviceGroupsStore' 
], 

相關存儲的ExtJS 4 getter方法有用於與「名稱空間」(devices.devicegroups.如實施例上文)中所定義的任何存儲自動生成的getter?我如何在我的init函數中獲得這個商店?

回答

1

吸氣名稱由getGetterName函數生成:

getGetterName: function(name, kindUpper) { 
     var fn  = 'get', 
      parts = name.split('.'), 
      numParts = parts.length, 
      index; 

     // Handle namespaced class names. E.g. feed.Add becomes getFeedAddView etc. 
     for (index = 0; index < numParts; index++) { 
      fn += Ext.String.capitalize(parts[index]); 
     } 

     fn += kindUpper; 

     return fn; 
    } 
+0

非常準確的答案,謝謝! –