Extjs 树列表不显示展开图标

问题描述 投票:0回答:1

我已将我的应用程序从版本 4 升级到版本 7,但是当我使用 xtype: 'treelist' 时,展开的图标不显示。我想显示该图标或更改为其他图标 image

{ xtype:“容器”, 布局:“hbox”, 项目: [ { xtype:“容器”, 布局:“hbox”, cls: "用户下拉菜单", 项目: [ { xtype:“按钮”, 文本: ””, 风格: { “背景图”: “网址(https://botanica.gallery/wp/wp-content/plugins/buddypress-first-letter-avatar/images/roboto/256/greek_924.png)”, “背景大小”:“封面”, "background-repeat": "不重复", “背景位置”:“中心”, 宽度:“28px”, 高度:“28px”, “填充底部”:“2px”, “边界半径”:“100%”, }, 菜单: { xtype:“菜单”, 身材: { 边框:“无”, boxShadow: "0 2px 10px rgba(0, 0, 0, 0.5)", }, 项目: [ { xtype:“容器”, 布局:“hbox”, 项目: [ { xtype:“面板”, 标题:“菜单”, 弹性:1, // 布局:'适合', 身材: {}, 标题:{ 风格: { 字体大小:“16px”, 字体粗细:“粗体”, }, }, 项目: [ { xtype:“树列表”, store: Ext.create("Ext.data.TreeStore", { 根: { 孩子们: [ { 文本:“收藏夹”, 可扩展:假, }, { 文本:“订单,计划”, 可扩展:假, }, { text: "跟踪,实时数据", 可扩展:假, }, { text: "开具发票,跟进", 可扩展:假, }, { text: "所有菜单点", 可扩展:假, }, ], }, }), 听众:{ itemmouseenter: 函数 ( 看法, 记录, 物品 ){ Ext.fly(item).setStyle({}); }, itemmouseleave: 函数 ( 看法, 记录, 物品 ){ Ext.fly(item).setStyle({}); }, },

                                  style: {
                                    fontSize: "14px",
                                    fontWeight: "normal",
                                    marginLeft: "-30px",
                                  },
                                },
                              ],
                            },
                            // Right Menu
                            {
                              xtype: "panel",
                              title: "All menupoints",
                              flex: 1,
                              layout: "fit",
                              bodyStyle: {
                                border: "none",
                              },
                              header: {
                                style: {
                                  fontSize: "16px",
                                  fontWeight: "bold",
                                },
                              },
                              items: [
                                {
                                  xtype: "treelist",
                                  store: Ext.create("Ext.data.TreeStore", {
                                    root: {
                                      children: [
                                        {
                                          text: "A",
                                          iconCls: "icon-help",
                                          expanded: true,
                                          style: {
                                            fontSize: "14px",
                                            fontWeight: "normal",
                                            marginLeft: "-30px",
                                          },
                                          children: [
                                            {
                                              text: "Addresses",
                                              leaf: true,
                                            },
                                            {
                                              text: "Address connections",
                                              leaf: true,
                                            },
                                            {
                                              text: "Address validation",
                                              leaf: true,
                                            },
                                          ],
                                        },
                                        {
                                          text: "B",
                                          iconCls: "icon-help",

                                          expanded: true,
                                          style: {
                                            fontSize: "14px",
                                            fontWeight: "normal",
                                            marginLeft: "-30px",
                                          },
                                          children: [
                                            {
                                              text: "Barcode scannings",
                                              leaf: true,
                                            },
                                          ],
                                        },
                                        {
                                          text: "C",
                                          expanded: true,
                                          style: {
                                            fontSize: "14px",
                                            fontWeight: "normal",
                                            marginLeft: "-30px",
                                          },
                                          children: [
                                            {
                                              text: "Calendar planner",
                                              leaf: true,
                                            },
                                            {
                                              text: "Chartek",
                                              leaf: true,
                                            },
                                            {
                                              text: "Chartek planner",
                                              leaf: true,
                                            },
                                            {
                                              text: "Chartek templates",
                                              leaf: true,
                                            },
                                            {
                                              text: "Claims",
                                              leaf: true,
                                            },
                                            {
                                              text: "Commodities",
                                              leaf: true,
                                            },
                                            {
                                              text: "Currencies",
                                              leaf: true,
                                            },
                                            {
                                              text: "Customers",
                                              leaf: true,
                                            },
                                          ],
                                        },
                                      ],
                                    },
                                  }),

                                  listeners: {
                                    itemmouseenter: function (
                                      view,
                                      record,
                                      item
                                    ) {
                                      Ext.fly(item).setStyle({});
                                    },
                                    itemmouseleave: function (
                                      view,
                                      record,
                                      item
                                    ) {
                                      Ext.fly(item).setStyle({});
                                    },
                                  },
                                  style: {
                                    fontSize: "14px",
                                    fontWeight: "normal",
                                  },
                                },
                              ],
                            },
                          ],
                        },
                      ],
                    },
                    listeners: {
                      click: function (button) {
                        var menu = button.getMenu();
                        if (menu) {
                          menu.showBy(button);
                        }
                      },
                    },
                  },
                ],
              },
            ],
          },
extjs extjs4 extjs4.2 extjs7 extjs7-classic
1个回答
0
投票

我编辑了你的代码并创建了一个fiddle

看完之后,好像一切都好。

Here it is.

您没有充分描述您的问题。 但我想你在加载css文件时遇到了一些错误。

© www.soinside.com 2019 - 2024. All rights reserved.