ExtJs 4 垂直数据视图

发布于 2025-01-06 06:13:25 字数 554 浏览 4 评论 0原文

我想知道是否可以创建垂直 DataView dataview 文档 dataview 示例

默认情况下,它从左侧渲染在 N 行中向右,换句话说,第二个元素位于第一个元素的右侧,

我正在寻找如何更改此行为以垂直布局它,因此第二个元素将位于第一个元素的下方。

顺便说一句,如果您确切知道 DataView 不可能做到这一点,请告诉我,因为我认为我可以使用 GridView 做到这一点(但不是以微不足道的方式)

UPDATE#1 所需的布局应如下:

  • 1,6
  • 2,7
  • 3,8
  • 4,9
  • 5,10

谢谢。

I would like to know is it possible to create vertical DataView dataview docs dataview sample

By defaylt it renders from left to right in N rows, in other words second element at the right of the first one,

I am looking how to change this behavior to layout it vertically, so the second element will be below first one.

BTW if you know exactly that it is impossible with DataView let me know, because I think I can do it with GridView (but not in a trivial manner)

UPDATE#1
Desired layout should be as follows:

  • 1,6
  • 2,7
  • 3,8
  • 4,9
  • 5,10

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风渺 2025-01-13 06:13:25

这可以通过使用 xindex、xcount 和parent 变量来实现。我通过分析源代码找到了它,您可能在 API 中找不到有关此解决方案的任何其他信息。示例模板:

'<tpl for=".">',
    '<tpl if="(xindex - 1) < (xcount / 2)">',
        '<div style="margin-bottom: 10px;" class="thumb-wrap">',
        '{src} ',
        '<tpl if="parent[xindex - 1 + Math.ceil(xcount / 2)] != undefined">',
            '{[parent[xindex - 1 + Math.ceil(xcount / 2)].src]}',
        '</tpl>',
        '</div>',
    '</tpl>',
'</tpl>'

工作示例:http://jsfiddle.net/6ZUej/1/

It's possible by using xindex, xcount and parent variables. I found it by analysing source, you probably won't find any additional information about this solution in API. Example template:

'<tpl for=".">',
    '<tpl if="(xindex - 1) < (xcount / 2)">',
        '<div style="margin-bottom: 10px;" class="thumb-wrap">',
        '{src} ',
        '<tpl if="parent[xindex - 1 + Math.ceil(xcount / 2)] != undefined">',
            '{[parent[xindex - 1 + Math.ceil(xcount / 2)].src]}',
        '</tpl>',
        '</div>',
    '</tpl>',
'</tpl>'

Working sample: http://jsfiddle.net/6ZUej/1/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文