在 Extjs 中设置 basecls 会破坏可拖动的容器
Setting a basecls in Extjs breaks draggable containers
我想创建一个具有特定 baseCls 且可拖动的容器。不幸的是,如果我添加一个 basCls,那么我的容器似乎不再可拖动。任何人都可以帮助我,以便我可以设置 baseCls 并拥有一个可拖动的容器。
这是一个 fiddle,其中有一个坏掉的例子。如果您注释掉 baseCls 它将正常工作:https://fiddle.sencha.com/#view/editor&fiddle/22b3
Ext.create('Ext.container.Container', {
title: 'Hello',
baseCls: 'cf-core-widget cf-core-widget-container',
width: 200,
html: '<p>World!</p>',
style: 'border: 1px solid black',
draggable: true,
renderTo: document.body
});
根据 the docs,container
的默认 baseCls
是 'x-component'
。如果您仍然需要组件行为,您应该保留那个行为,只根据需要添加其他行为。
baseCls: 'x-component cf-core-widget cf-core-widget-container',
我想创建一个具有特定 baseCls 且可拖动的容器。不幸的是,如果我添加一个 basCls,那么我的容器似乎不再可拖动。任何人都可以帮助我,以便我可以设置 baseCls 并拥有一个可拖动的容器。
这是一个 fiddle,其中有一个坏掉的例子。如果您注释掉 baseCls 它将正常工作:https://fiddle.sencha.com/#view/editor&fiddle/22b3
Ext.create('Ext.container.Container', {
title: 'Hello',
baseCls: 'cf-core-widget cf-core-widget-container',
width: 200,
html: '<p>World!</p>',
style: 'border: 1px solid black',
draggable: true,
renderTo: document.body
});
根据 the docs,container
的默认 baseCls
是 'x-component'
。如果您仍然需要组件行为,您应该保留那个行为,只根据需要添加其他行为。
baseCls: 'x-component cf-core-widget cf-core-widget-container',