mankz
29 Dec 2009, 1:16 AM
The width is a little too small when using the editor on a span/label with no width assigned. Test case:
http://www.extjs.com/deploy/dev/examples/simple-widgets/editor.html
Run this in Firebug (edits the panel title el)
var cfg = {
shadow: false,
completeOnEnter: true,
cancelOnEsc: true,
updateEl: true,
autoSize : 'width',
ignoreNoChange: true
};
var labelEditor = new Ext.Editor(Ext.apply({
alignment: 'l-l',
listeners: {
beforecomplete: function(ed, value){
if(value.charAt(value.length - 1) != ':'){
ed.setValue(ed.getValue() + ':');
}
return true;
},
complete: function(ed, value, oldValue){
Ext.example.msg('Label Changed', '"{0}" changed to "{1}"', oldValue, value);
}
},
field: {
allowBlank: false,
xtype: 'textfield',
selectOnFocus: true
}
}, cfg));
labelEditor.startEdit(Ext.getDom('ext-gen6'));
http://www.extjs.com/deploy/dev/examples/simple-widgets/editor.html
Run this in Firebug (edits the panel title el)
var cfg = {
shadow: false,
completeOnEnter: true,
cancelOnEsc: true,
updateEl: true,
autoSize : 'width',
ignoreNoChange: true
};
var labelEditor = new Ext.Editor(Ext.apply({
alignment: 'l-l',
listeners: {
beforecomplete: function(ed, value){
if(value.charAt(value.length - 1) != ':'){
ed.setValue(ed.getValue() + ':');
}
return true;
},
complete: function(ed, value, oldValue){
Ext.example.msg('Label Changed', '"{0}" changed to "{1}"', oldValue, value);
}
},
field: {
allowBlank: false,
xtype: 'textfield',
selectOnFocus: true
}
}, cfg));
labelEditor.startEdit(Ext.getDom('ext-gen6'));