Search code examples
javascriptextjssyntax-erroraliaspanel

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 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


Solution

  • 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: [{
             ...
          }],
    });