2011-07-15 53 views
2

如果单元格的文本大于该单元格中的拟合值,是否可以使该单元格跨越多个列?跨多个列跨度ExtJS网格单元格内容

例如,此刻我的网格看起来是这样的:

+--------+----------+-----+-----+-----+ 
|Product |Descrip...|  |  |  | 
+--------+----------+-----+-----+-----+ 

由于第二列的内容太大,以适应单元格,内容将被截断。

我希望能够看到Description列的整个文本。因此跨越单元格,如图所示:

+--------+----------+-----+-----+-----+ 
|Product |Description of the product | 
+--------+----------+-----+-----+-----+ 

这可能与ExtJS 4网格?

回答

1

您可以在指定的列的宽度,以获得所需柱尺寸如下:

var grid = Ext.create('Ext.grid.Panel',{   
id : 'example_grid', 
columns : [{ 
id : 'product', 
header : 'Product', 
width : 50 
},{ 
id : 'description', 
header : 'Description of the Product', 
width : 150 
}] 
}); 
0

我几乎可以肯定,这是不可能的。不过,您可以使用摘要插件来显示整行内容。

0

我怀疑你可以连接extjs4网格中的单元格。但是你可以让文本继续下一行。

.wrapme { 
    /** this rule is for css3. **/ 
    /** You can find crossbrowser workaround on the internet **/ 
    white-space: pre-wrap; 
    word-wrap: break-word; 
} 

然后包括CLS到列配置

{ 
    id : 'description', 
    header : 'Description of the Product', 
    width : 150, 
    cls : 'wrapme' 
}