ExtJS 4控制器存储的Getter方法

时间:2016-01-13 12:31:02

标签: extjs extjs4

在我的控制器中,我定义了相关的商店,如

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

对于具有“名称空间”(devices.devicegroups.的已定义商店是否有自动生成的getter,如上例所示)?我如何在我的init函数中获得此商店?

1 个答案:

答案 0 :(得分:1)

getter名称由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;
    }