2011-01-29 41 views
1

大家好我得到了下面的问题,我有一个RowEditor一个的GridPanel然而它不验证我的领域,当它呈现 enter image description hereExtJS的RowEditor如何渲染负载

但是,如果我把全部的组件验证我所有的字段修改和刷新电网它只是表现为我想他们首先

enter image description here

您能否提供我什么事?谢谢!!

回答

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; 
    } 
}