如何在 Extjs 中自定义 errorSummary? errorSummary 的默认标题是“Errors”(附上截图供引用),有什么办法可以将其更改为其他内容吗?

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

最佳答案

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

关于extjs - 如何将 errorSummary 的默认标题从 "Errors"更改为 EXTJ 中的其他内容,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42621057/

10-12 13:13