PDA

View Full Version : how to change rowediting button text?



youj2006
25 Feb 2015, 12:45 AM
Hi,
As your know in rowediting there're two button:"Update and Cancel", how to change their text?
Another question: can spreadsheet selection model use rowediting?

yeghikyan
25 Feb 2015, 3:23 AM
Ext.application({ name : 'Fiddle',


launch : function() {
Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data: [
{"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
{"name":"Bart", "email":"bart@simpsons.com", "phone":"555-222-1234"},
{"name":"Homer", "email":"homer@simpsons.com", "phone":"555-222-1244"},
{"name":"Marge", "email":"marge@simpsons.com", "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'}
],
selModel: 'rowmodel',
plugins: {
ptype: 'rowediting',
clicksToEdit: 1,
// ---------------------------------------------------------------
saveBtnText: "IamSaveText",
cancelBtnText: "IamCancelText"
// ---------------------------------------------------------------
},
height: 200,
width: 400,
renderTo: Ext.getBody()
});
}
});