PDA

View Full Version : How to disable the clicksToMoveEditor feature of the RowEditing plugin?



andong
11 Nov 2013, 1:13 AM
I don't want to move the editor while one row is editing, I had set the clicksToMoveEditor property to 10 for my purpose, but it still can move the editor.

How to reach this goal in ExtJS 4.2?

andong
11 Nov 2013, 9:12 PM
Anybody know it?

andong
12 Nov 2013, 9:28 PM
Up up up!

scottmartin
13 Nov 2013, 4:52 PM
You could do something like this



Ext.onReady(function(){

var store = Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'change'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "change":100 },
{ 'name': 'Bart', "email":"bart@simpsons.com", "change":-20 },
{ 'name': 'Homer', "email":"home@simpsons.com", "change":23 },
{ 'name': 'Marge', "email":"marge@simpsons.com", "change":-11 }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});

var editor = {
xtype: 'textfield',
allowBlank: false
};

var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
listeners: {
beforeedit: function(ed, e) {
return !ed.editor.isVisible();
}
}
});

Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: store,
columns: [
{ header: 'Name', dataIndex: 'name', editor: editor },
{ header: 'Email', dataIndex: 'email', flex: 1, editor: editor },
{ header: 'Change', dataIndex: 'change', editor: editor }
],
height: 200,
width: 400,
renderTo: Ext.getBody(),

plugins: [rowEditing]
});

});

IraidaGilyard
14 Nov 2013, 3:10 AM
That seems to be pretty much complicated.








Tevida (http://www.healthisgod.com/tevida-testosterone-booster/)