ExtJS:如何使网格行高增长以适应文本块?

时间:2015-06-27 12:03:33

标签: extjs extjs5 sencha-architect

我有一个看起来像这样的网格面板:

enter image description here

定义者:

{
    xtype: 'gridpanel',
    title: 'Disclaimer questions',
    bind: {
        store: '{QuestionStore}'
    },
    columns: [{
        xtype: 'gridcolumn',
        dataIndex: 'labelText',
        text: 'Question text',
        flex: 1
    }, {
        xtype: 'gridcolumn',
        dataIndex: 'answerings',
        text: 'Answerings',
        flex: 1
    }, {
        xtype: 'gridcolumn',
        dataIndex: 'answerText',
        text: 'Answer text',
        flex: 1
    }]
}

如何使行的高度增加到文本的大小,而不是用“......”切断它?

1 个答案:

答案 0 :(得分:2)

从ExtJS 5开始,在列定义中,包括" cellWrap:true"。

columns: [{
    xtype: 'gridcolumn',
    cellWrap: true,   // <---------------------------------------
    dataIndex: 'labelText',
    text: 'Question text',
    flex: 1
}, {
    xtype: 'gridcolumn',
    dataIndex: 'answerings',
    text: 'Answerings',
    flex: 1
}, {
    xtype: 'gridcolumn',
    dataIndex: 'answerText',
    text: 'Answer text',
    flex: 1
}]