PDA

View Full Version : Hot to change input-field in a grid-roweditor



dobberph
19 Oct 2012, 6:35 AM
Hi all,

I have a gridpanel with a roweditor provided in a MVC-program.
Now I want one editor-field of a date to appear as a button with a
special functionality. By clicking the button the actual date in the field
should change to the current date.
I have no idea how to do this. Here ist the code of my view without
the other fields. Perhaps some has an idea?

Thanks a lot,
Tobias



Ext.define('pruefkoepfeApp.view.view_kontakttechnik', {
extend: 'Ext.grid.Panel',
alias: 'widget.view_kontakttechnik',
autoRender: false,
autoShow: false,
id: 'view_kontakttechnik',
itemId: 'view_kontakttechnik',
autoScroll: false,
store: 'store_kontakttechnik',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
viewConfig: {
},
columns: [
...,
{
xtype: 'datecolumn',
width: 70,
dataIndex: 'referenzecho_lastchange',
text: '(geprüft)',
tooltip: '(letzte Änderung)',
format: 'd.m.Y',
editor: {
xtype: 'datefield',
fieldLabel: 'Label',
hideLabel: true,
format: 'd.m.Y'
}
},
...
],
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
ptype: 'rowediting',
pluginId: 'kontakttechnik_roweditorPlugin',
errorSummary: false
})
],
selModel: Ext.create('Ext.selection.RowModel', {}),
... (some docked toolbars)
});

me.callParent(arguments);
}

});

scottmartin
19 Oct 2012, 10:53 AM
Can you just use a triggerfield?
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Trigger

Scott.