locked
How to populating the left items seen when sub-tab is loaded in custom extension RRS feed

  • Question

  • Hi,

    I need to  populating the left items seen when sub-tab is loaded in my custom extension.Here is a deom.

    // This method is responsible for populating the left items seen when sub-tab is loaded.
        function loadContainersNavigationItemsDataFunction(data, originalPath, extension) {
            var items = $.map(global.StorageSampleTenantExtension.Controller.getContainersDataSet().data,
                  function (value) {
                      return $.extend(value, {
                          name: value.ContainerId,  // This is the id of object.
                          displayName: value.ContainerName,
                          uniqueId: value.ContainerId,
                          navigationPath: {
                              type: value.Type,     // This is the type of object, you need to set this as a property in JSON data model.
                              name: value.ContainerId
                          }
                      });
                  }
              );
    
            // Note: The following way of finding the subscription id for specific container id is not ideal.
            // This is done more as a hack. 
            // 设置按钮下面的跳转链接,用于快速返回其他container
            var i, itemCount;
            for (i = 0, itemCount = items.length; i < itemCount; i++) {
                if (items[i] && items[i].ContainerId == selectedContainerId) {
                    selectedSubscriptionId = items[i].SubscriptionId;
                    break;
                }
            }
    
            return {
                data: items,
                backNavigation: {
                    // This should be the id of the tab registered in navigation.
                    // Note most of these matching are case-sensitive, yes **SENSITIVE**
                    view: "containers" 
                }
            };
        }


    types: [
                {
                    name: "Container", // This is the type name of the object.
                    dataFunction: loadContainersNavigationItemsDataFunction,
                    tabs: [
                            {
                                id: "Files",
                                displayName: "files",
                                template: "StorageFilesTab",
                                activated: function (extension, renderArea, renderData) {
                                    loadStorageFilesTab(extension, renderArea, renderData);
                                }
                            },
                    ]
                }
            ]

    But the normal left item will be in selected style after clicked. up code will not.

    normal

    normal

    my

    can you help me ?


    ...

    Friday, August 18, 2017 11:52 PM

All replies