错误:尝试使用布局别名“border”时未识别别名。

huangapple go评论64阅读模式
英文:

error Unrecognized alias when i try use layout: "border"

问题

I try to create panel element with layout: 'border' and get next error: Unrecognized alias: layout.border
我尝试创建具有布局:'border' 的面板元素,并出现以下错误:未识别的别名:layout.border

I try to find any answer, but all I could find similar to the answer is the following discussion Unrecognized alias. The solution given in the article did not help me, unfortunately, please tell me how to fix this error
我尝试寻找答案,但我找到的与答案类似的内容只有以下讨论 Unrecognized alias。文章中提供的解决方案对我没有帮助,不幸的是,请告诉我如何修复这个错误

This is are link to my Fiddle Fiddle
这是我的 Fiddle 链接 Fiddle

英文:

I try to create panel element with layout:'border' and get next error:Unrecognized alias: layout.border
I try to find any answer, but all I could find similar to the answer is the following discussion Unrecognized alias. The solution given in the article did not help me, unfortunately, please tell me how to fix this error
This is are link to my Fiddle Fiddle

答案1

得分: 2

看起来 "Ext.layout.container.Border" 布局在 Ext JS Modern Toolkit 中不可用。相反,它在 Classic Toolkit 中可用。在 Modern Toolkit 中,用于创建边框布局的等效布局是 "Ext.layout.Box"。您可以更新您的代码以使用 "box" 布局。以下是修改后的代码:

Ext.define("ModernApp.view.customLayout.CustomLayoutView", {
  extend: "Ext.panel.Panel",
  alias: "widget.custom",
  requires: ["Ext.layout.Box"], // 更新布局要求
  layout: "box", // 使用 'box' 布局代替 'border' 布局
  items: [{
         // ...
      }],
});
英文:

It seems that the "Ext.layout.container.Border" layout is not available in Ext JS Modern Toolkit. It is available in the Classic Toolkit instead.In the Modern Toolkit, the equivalent layout for creating a border layout is "Ext.layout.Box". You can update your code to use the "box" layout instead. Here's the modified code:

Ext.define("ModernApp.view.customLayout.CustomLayoutView", {
  extend: "Ext.panel.Panel",
  alias: "widget.custom",
  requires: ["Ext.layout.Box"], // Update the layout requirement
  layout: "box", // Use 'box' layout instead of 'border'
  items: [{
         ...
      }],
});

huangapple
  • 本文由 发表于 2023年6月6日 17:02:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76413003.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定