【问题标题】:Need some container in sencha gxt that can be similar to table in html在 sencha gxt 中需要一些类似于 html 中的表格的容器
【发布时间】:2014-12-27 04:34:27
【问题描述】:

我想做下面的事情。

Label1 : Value1            Label2 : Value2
Label3 : Value3            Label4 : Value4

现在使用 html 来做同样的事情,我用它来创建一个包含 7 列和 2 行的表,以便所有元素都正确对齐。

如何在 Sencha gxt 中使用一些容器来做同样的事情?

【问题讨论】:

  • 尝试使用 com.extjs.gxt.ui.client.widget.grid.Grid 类。
  • 但我不想要网格。是不是有一些像 Horizo​​ntal Container 之类的容器。

标签: java html extjs containers gxt


【解决方案1】:

尝试在 sencha gxt 中也可以使用的布局属性:

{
    xtype: 'container',
    layout: {
        type: 'table',
        columns: 7
    },
    items: [
       {
           html: 'Label1'
       },
       {
           html: ':'
       },
       {
           html: 'Value1',
       },
       {
           html: ''
           width: 50
       },
       {
           html: 'Label2'
       },
       {
           html: ':'
       },
       {
           html: 'Value2'
       },
       // next row
       {
           html: 'Label3'
       },
       {
           html: ':'
       },
       {
           html: 'Value3',
       },
       {
           html: ''
           width: 50
       },
       {
           html: 'Label4'
       },
       {
           html: ':'
       },
       {
           html: 'Value4'
       },
    ]
}

如果需要,您可以在项目上使用 colspan/rowspan。

这是一个小提琴演示:https://fiddle.sencha.com/#fiddle/fja

【讨论】:

    猜你喜欢
    • 2013-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多