ExtJS RowEditor如何在加载时呈现所有组件验证

时间:2011-01-29 22:03:33

标签: extjs editor rendering gridpanel

大家好我得到了以下问题,我有一个带有RowEditor的GridPanel但是当它呈现时它不会验证我的字段 enter image description here

但是,如果我将所有字段都集中在编辑和刷新网格上,它就会像我想要的那样首先出现

enter image description here

你可以给我一些建议吗?谢谢!

1 个答案:

答案 0 :(得分:1)

RowEditor使用 Ext.form 包组件,例如:“TextField”“DateField”“ComboBox”等等......并且验证由它们执行。网格没有这样的功能来验证。验证功能可以通过列的渲染器配置选项来实现。例如,您的描述列配置可能如下所示:

{
    header    : 'Description',
    dataIndex : 'description',
    renderer  :function(description, metaData){
        if(!description){
            //if description is blank let background of it be red.
            medaData.style+="background-color:red;"; //or whatever css can be applied
        }
        return description;
    }
}
相关问题