ExtJS 门户和 portlet 可以像通常的 CSS 元素一样定位吗?
我想让一个门户及其 ExtJS portlet 适合固定宽度的布局。现在它们似乎占据了 100% 的宽度,并且元素似乎应用了内联样式来提供最大宽度,而为门户项目指定“width: 50%”样式之类的技巧似乎没有任何作用。
如何调整 Portlet 的大小和位置?是否有任何方法可以应用常用的 CSS 定位技巧?生成的 HTML 出现在 Inspect Element 上时具有指定宽度(以像素为单位)的内联样式,这将胜过我在样式表中放置的任何内容。
我希望像常规块元素一样显示门户,并在页面内进行相对定位。这可能吗?如果不可能,我的下一个最佳选择是什么?
I would like to make a portal and its ExtJS portlets fit within a fixed-width layout. Right now they seem to take 100% of the width, and the elements appear to have inline styles applied to give max width, and tricks like specifying a style of "width: 50%" for the portal's items do not appear to do anything.
How can portlets be sized and positioned, and is there any way to apply usual CSS positioning skill? The generated HTML as it appears on Inspect Element has an inline style specifying a width in pixels, which will trump whatever I put in a stylesheet.
I would like to have a portal be displayed like a regular block element with relative positioning within a page. Is that possible, and if not, what are my next best options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Portlet 由布局管理,布局用于设置大小、响应视口调整大小等。您必须修改现有布局或创建您自己的自定义布局才能执行此操作(或者构建您自己的门户,该门户不基于现有的例子)。
The portlets are managed by a layout, which is what sets sizes, responds to viewport resizes, etc. You would have to modify the existing layout or create your own custom layout to do this (or else build your own portal that's not based off of the existing example).
看来我已经有了答案。覆盖视口定义以自定义 div 标签的渲染。这是我的代码:
其中 me.el 是元素渲染的 id。
it seems i have the answer. Overwrite the viewport definition for customize the render to a div tag. Here is my code:
where me.el is the id of element render.