2017-03-06 26 views
3

如何自定義Extjs中的errorSummary? errorSummary的默認標題是「錯誤」(附帶截圖供參考),有什麼方法可以將其更改爲其他內容?如何將錯誤摘要的默認標題從「錯誤」更改爲EXTJ中的其他內容

Image

Ext.create('Ext.data.Store',{ 
storeId:'simpsonsStore', 
fields:['name', 'email', 'phone'], 
data: [ 
    {"name":"Lisa", "email":"[email protected]", "phone":"555-111-1224"}, 
    {"name":"Bart", "email":"[email protected]", "phone":"555--222-1234"}, 
    {"name":"Homer", "email":"[email protected]", "phone":"555-222-1244"}, 
    {"name":"Marge", "email":"[email protected]", "phone":"555-222-1254"} 
] 
}); 

Ext.create('Ext.grid.Panel', { 
title: 'Simpsons', 
store: Ext.data.StoreManager.lookup('simpsonsStore'), 
columns: [ 
    {header: 'Name', dataIndex: 'name', editor: 'textfield'}, 
    {header: 'Email', dataIndex: 'email', flex:1, 
     editor: { 
      xtype: 'textfield', 
      allowBlank: false 
     } 
    }, 
    {header: 'Phone', dataIndex: 'phone'} 
], 
selType: 'rowmodel', 
plugins: [ 
    Ext.create('Ext.grid.plugin.RowEditing', { 
     clicksToEdit: 1, 
     errorSummary:true, 
    }) 
], 
height: 200, 
width: 400, 
renderTo: Ext.getBody() 
}); 

回答

3
plugins: [ 
    Ext.create('Ext.grid.plugin.RowEditing', { 
     clicksToEdit: 1, 
     errorsText:'test', 
     errorSummary:true 
    }) 
], 
+0

感謝@MrBruno :),它的工作 –

+0

@JojoRaghav如果它的工作,請標記爲正確答案 –

1

如果你想在全球範圍內改變它,我們可以通過下面的代碼重寫編輯插件。

 Ext.define('OverridedRowEditing',{ 
     override: 'Ext.grid.plugin.RowEditing', 
     config: { 
      errorsText: 'Test' 
     } 
    }); 
相關問題