2011-01-29 79 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; 
    } 
}